/// <summary> /// Contract_List页面行为 /// </summary> /// <returns>视图</returns> public ActionResult Contract_List() { //获取往来客户信息 ClientsFactory clientsfactory = new ClientsFactory(); List <IClientsB> lstclients = clientsfactory.GetDataClients(); List <ClientsM> clientsm = new List <ClientsM>(); if (lstclients != null && lstclients.Count > 0) { lstclients.ForEach(p => clientsm.Add(p.Infomation_clients)); } ViewBag.ClientsInfo = clientsm; //获取项目信息 ProjectsFactory projectsfactory = new ProjectsFactory(); List <IProjectsB> lstprojects = projectsfactory.GetDataProjects(); List <ProjectsM> projectsm = new List <ProjectsM>(); if (lstprojects != null && lstprojects.Count > 0) { lstprojects.ForEach(p => projectsm.Add(p.Infomation_projects)); } ViewBag.ProjectsInfo = projectsm; //获取合同信息 string id = ViewMethods.GetForm(Request, "ID", CommonEnums.ValueEnum.vlGet).ToString(); ContractFactory contractfactory = new ContractFactory(); IContractB lstContract = contractfactory.GetDataByID(id); ContractM contractm = (lstContract != null ? lstContract.Infomation_contract : null); ViewBag.ContractInfo = contractm; return(View()); }
/// <summary> /// 编辑业主信息(Contract_Edit页面) /// </summary> public ActionResult Edit_Contract() { ContractFactory contractfactory = new ContractFactory(); //获取业主编号(id)信息 string id = ViewMethods.GetForm(Request, "ID", CommonEnums.ValueEnum.vlGet).ToString(); IContractB contractb = contractfactory.GetDataByID(id); ContractM contractm = (contractb == null ? null : contractb.Infomation_contract); //编辑业主信息 string contractname = ViewMethods.GetForm(Request, "name", CommonEnums.ValueEnum.vlPost).ToString(); string contractbelong = ViewMethods.GetForm(Request, "belong", CommonEnums.ValueEnum.vlPost).ToString(); contractm.CTName = contractname; contractm.CTBelong = contractbelong; contractfactory.Infomation_contract = contractm; ViewBag.ContractInfo = contractm; bool isSuccess = contractfactory.Update(); if (isSuccess) { return(ViewMethods.AlertBack("修改成功", "../../Contract/Contract")); } else { return(ViewMethods.AlertBack("修改失败", "-1")); } }
/// <summary> /// 转换成业务逻辑层的对象 /// </summary> /// <param name="contractn">集团内合同信息(模型层)</param> /// <returns>(业务逻辑层)对象</returns> IContractB ConvertToContract_B(ContractM contractm) { IContractB result = null; if (contractm != null) { result = new ContractB(contractm, this._connectionb); } return(result); }
/// <summary> /// Contract_Edit页面行为 /// </summary> /// <returns>视图</returns> public ActionResult Contract_Edit() { //获取往来客户(id)数据信息 string id = ViewMethods.GetForm(Request, "ID", CommonEnums.ValueEnum.vlGet).ToString(); ContractFactory contractfactory = new ContractFactory(); IContractB lstContract = contractfactory.GetDataByID(id); ContractM contractm = (lstContract != null ? lstContract.Infomation_contract : null); ViewBag.ContractInfo = contractm; return(View()); }
public static void Main(string[] args) { Uri address = new Uri("net.pipe://localhost/Service/"); ServiceHost host = new ServiceHost(new Service(), address); NetNamedPipeBinding binding = new NetNamedPipeBinding(); host.AddServiceEndpoint(typeof(IContractA), binding, string.Empty); host.AddServiceEndpoint(typeof(IContractB), binding, string.Empty); host.AddServiceEndpoint(typeof(IContractC), binding, string.Empty); host.Open(); IContractA proxyA = ChannelFactory<IContractA>.CreateChannel(new NetNamedPipeBinding(), new EndpointAddress(address)); proxyA.A(); ((IClientChannel)proxyA).Close(); IContractB proxyB = ChannelFactory<IContractB>.CreateChannel(new NetNamedPipeBinding(), new EndpointAddress(address)); proxyB.B(); ((IClientChannel)proxyB).Close(); IContractC proxyC = ChannelFactory<IContractC>.CreateChannel(new NetNamedPipeBinding(), new EndpointAddress(address)); proxyC.C(); ((IClientChannel)proxyC).Close(); host.Close(); }
public TwoConstructorsWithOverride(IContractA a, IContractB b) { }
/// <summary> /// 实例化对象 /// </summary> /// <param name="strNameSpace">命名空间</param> /// <param name="strInstance">实例名</param> void InstanceObject(string strNameSpace, string strInstance) { this._contractb = PublicMethods.Methods.InstanceObject(strNameSpace, strInstance, new object[] { this._connectionfactory.ConnectionB }) as IContractB; }