Jul 9, 2014

DI Development

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged




IntelliModules.Utils
CommonUtil.cs
namespace IntelliModules.Utils
{
    public class CommonUtil
    {
        public static void InitiateAuthenticationBootStrapper(object objectToBuildUp)
        {
            CommonBootStrapper.Restart();
            CommonBootStrapper.Configure<AuthenticationBootStrapper>();
            CommonBootStrapper.BuildUp(objectToBuildUp);
        }
    }
}
IntelliModules.CommonRegistries
CommonBootStrapper.cs
namespace IntelliModules.CommonRegistries
{
    public class CommonBootStrapper
    {
        private static bool bootCompleted;

        public virtual void Configure()
        {
            throw new NotImplementedException();
        }

        public void BootstrapperMap()
        {
            ObjectFactory.Initialize(x =>
                {
                    x.IgnoreStructureMapConfig = true;
                    x.UseDefaultStructureMapConfigFile = true;

                });
        }
        public static void Restart()
        {
            if (bootCompleted)
            {
                ObjectFactory.ResetDefaults();
            }
            else
            {
                Bootstrap();
            }

        }
        public static void Bootstrap()
        {
            new CommonBootStrapper().BootstrapperMap();
            bootCompleted = true;
        }

        public static void Configure<T>() where T : CommonBootStrapper, new()
        {
            new T().Configure();
        }

        public static void BuildUp(object objectbuildup)
        {
            ObjectFactory.BuildUp(objectbuildup);
        }

    }
}


AuthenticationRegistry.cs

namespace IntelliModules.CommonRegistries
{
   public  class AuthenticationRegistry:Registry
    {
       public  AuthenticationRegistry()
       {
           For<IEmployeeManger>().Use<EmployeeManager>();
           SetAllProperties(x=>x.OfType<IEmployeeManger>());

           For<IEmployeeDataManager>().Use<EmployeeDataManager>();
           SetAllProperties(x=>x.OfType<IEmployeeDataManager>());
       }
    }
}

AuthenticationBootStrapper.cs

namespace IntelliModules.CommonRegistries
{
    public class AuthenticationBootStrapper :CommonBootStrapper
    {
        public override void Configure()
        {
            ObjectFactory.Configure(x => x.AddRegistry<AuthenticationRegistry>());
        }
    }
}

#region Private Fields
        private IAdminDataManager m_AdminDataManager;
        #endregion

        #region Constructor
        public AdminManager(IAdminDataManager adminDataManager)
        {
            m_AdminDataManager = adminDataManager;
        }
        #endregion

        public AdminModels GetAdminUsers(string companyname)
        {
            return m_AdminDataManager.GetAdminUsers(companyname);
        }


public class AssetDataManager : IAssetDataManager
    {

        private readonly TIMPublicEntities publiccontext;

Jun 3, 2014

WebGrid

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged

@grid.GetHtml(tableStyle: "SearchGrid",
            headerStyle: "gridHeaderStyle",
            rowStyle: "gridRowStyle",
            alternatingRowStyle: "gridAlternatingRowStyle",
            selectedRowStyle: "gridSelectedRowStyle",
            columns: grid.Columns(                 
             grid.Column("", header: " ", format: @<text> @Html.ActionLink(" ", "ViewUser", new { UserID = item.UserID },new {
                    }) </text>),                 
            grid.Column("UserId", "Id"),
            grid.Column("CompanyName", "Company Name"),
            grid.Column("Website", "Website"),
            grid.Column("City", "City"),                   
            grid.Column("Country", "Country"),                
            grid.Column("WorkPhone", "Work Phone"),                 
            grid.Column("MobilePhone", "Mobile Phone"),
            grid.Column("Currency", "Currency")
            )
            )

Feb 5, 2014

MVC How Can Dynamically parameter set partial view using jquery?



MVC How Can Dynamically parameter set  partial view using jquery?

Load Value: View the Grid

$("#yourdiv").load("@Url.Action("Compensationpayment", "StructureFinance")", { 'id': 'null' }, function (response, status, xhr) {
                        if (status == "error") {
                            alert("An error occurred while loading the results.");
                        }
                    });

              Dynamic Change dropdown value to change value to grid

                             
$('#ddlConductionDeductionyear').change(function(e)
                    {
                        var data=$(this).val();
                        
                        $("#yourdiv").load("@Url.Action("Compensationpayment", "StructureFinance")", { 'id': data }, function (response, status, xhr)
                        {
                            if (status == "error") {
                                alert("An error occurred while loading the results.");
                            }
                        });

                      
                    });


View


@Html.DropDownListFor(Model=>Model.CompensationpaymentYEARID, (SelectList)ViewData["Select"], new { id="ddlConductionDeductionyear",@class = "DdlMedium" })

<table>
<tr>
<td>
<div id="yourdiv"></div>
</td>
</tr>
</table>


Partial View: Compensationpayment
@{
    ModelLibrary.Models.SFCompensationPayment casAcc = new ModelLibrary.Models.SFCompensationPayment();
}

@{
    var grid = new WebGrid(Model);
}
<div>
<section>
@using (Html.BeginForm("Compensationpayment", "StructureFinance"))
{

<div id="leftside" class="leftside" style="padding-top: 2px; padding-bottom: 0px;  overflow-x: scroll;width: 1030px;">
    <div id="gridContent">
        @grid.GetHtml(tableStyle: "SearchGrid",
                headerStyle: "gridHeaderStyle",
                rowStyle: "gridRowStyle",
                alternatingRowStyle: "gridAlternatingRowStyle",
                selectedRowStyle: "gridSelectedRowStyle",
                columns: grid.Columns(
                  grid.Column("", header: "", format: @<text> @Html.ActionLink(" ", "LoanAgreement", "StructureFinance",null, new
                                                        {
                                                            style = "ackground: url('" + Url.Content("~/images/e2.gif") + "') no-repeat center right; display:block; height:18px; width:18px;"
                                                        }) </text>),
                grid.Column("Repaymentdate", "Date"),
                grid.Column("ConductionDeductionTypeName", "what"),
                grid.Column("RepaymentCCyAmt", "Amnount"),
                grid.Column("RepaymentCCyName", "Currency"),
                grid.Column("Valuedate", "Value date"),
                grid.Column("Numberofdays", "Number of days"),
                grid.Column("InterestRate", "LIBOR"),
                grid.Column("IRLIBOR", "IRLIBOR"),
                grid.Column("CPIRmargin", "IR Margin"),
                grid.Column("CPFixedmargin", "Fixed Margin")

         ))
    </div>
    </div>
}
</section>
</div>

Output:




Structure Finance: it can be used a controller.
Compensation payment: it can be used an Action Result using Partial View

In this above article very useful one page to another page view result get partial view data using dynamically parameter can send get value u can use. drop down select change value considering the grid value



Recent Posts
Popular Articles

 

© 2013 MUNISH ORACLE DBA& .Net Developer. All rights resevered. Designed by Templateism

Back To Top