/// <summary> /// /// </summary> /// <param name="id"></param> /// <returns></returns> private ClientInfoModel LoadClientModel(Int32 id) { IDataSource i_datasource = DataSourceCreator.CreateDataSource(); ClientInfoModel model = i_datasource.LoadClientInfo(id); model.SuccessSave += (o, e) => { if (0 == id) { // add new var new_client = new ClientRowModel(model.Id, model.Name, model.SecondName, model.ThirdName); this.AddClient(new_client); this.SelectedClient = new_client; } else { // refresh var client = this.Clients.Where(c => c.Id == model.Id). FirstOrDefault(); if (null != client) { client.Name = model.Name; client.SecondName = model.SecondName; client.ThirdName = model.ThirdName; } this.SelectedClient = client; } }; return(model); }
/// <summary> /// /// </summary> /// <param name="id"></param> /// <returns></returns> public ClientInfoModel LoadClientInfo(Int32 id) { ClientInfoModel result = null; if (id == 0) { // может в будущем еще надо сделать result = new ClientInfoModel(SaveClientInfo); } else { using (var db_context = new iMedDataContext()) { var client_bbdd = db_context.Clients.Where(c => c.Id == id). FirstOrDefault(); if (client_bbdd == null) { throw new IMedDataSourceException(String.Format("Client with id:{0} not found", id)); } result = new ClientInfoModel(SaveClientInfo) { Id = client_bbdd.Id, Name = client_bbdd.Name, SecondName = client_bbdd.SecondName, ThirdName = client_bbdd.ThirdName, BirthDay = client_bbdd.DateBirth, Address = client_bbdd.Address }; } } return(result); }
public string New(FormCollection coll) { string case_no = coll["Case.casenum"]; NeedlesModel model = new CheckListController().GetModel(case_no); ClientInfoModel clientInfo = new ClientInfoModel { Client = new tblClient { id = 0, Client_Name = model.Party.last_long_name + ", " + model.Party.first_name, Employer_Name = model.Employer.last_long_name, Escrow = 0f, //Handling_Atty = model.Case.staff_1, Handling = 0.67f, //Credit_Atty = model.Case_Data.CREDIT_ATTY, Credit = 0.33f, County = model.Case_Data.County, Accident_Desc = model.Case.synopsis } }; ContentResult result = Save(clientInfo) as ContentResult; new CheckListController().Update_Fee_Pkg_No(case_no, result.Content); return(clientInfo.Client.id.ToString()); }
private ClientInfoModel GetModel() { ClientInfoModel model = new ClientInfoModel { Clients = db.tblClients .Where(x => x.Client_Name != null) .OrderBy(x => x.Client_Name).ToList(), Attys = db.tblClientReferrals//.GroupBy(x => x.Client_Referral_Atty) .Select(c => new ListClass { Id = c.Client_Referral_Atty, Name = c.Client_Referral_Atty }).Distinct() .OrderBy(x => x.Name) .ToList(), Hand_Attys = db.tblAttorneys .Select(c => new ListClass { Id = c.Atty_Initials, Name = c.Atty_Name }).Distinct() .OrderBy(x => x.Name) .ToList(), }; return(model); }
private ClientInfoModel GetReferralEscrowModel(DateTime fromDate, DateTime toDate) { ClientInfoModel model = new ClientInfoModel { ReferralEscrow = (from clt in db.tblClients join cla in db.tblClaims on clt.id equals cla.Reference_Number join pay in db.tblPayments on cla.Claim_Number equals pay.Claim_Number join atty in db.tblAttyDescs on cla.Attorney_Breakdown equals(int) atty.Combo_Indicator join cltref in db.tblClientReferrals on clt.id equals cltref.Reference_Number join refer in db.tblReferrals on cltref.Client_Referral_Atty equals refer.Referral_Name where pay.Input_Date >= fromDate && pay.Input_Date <= toDate //&& pay.Posted_Indicator == true orderby atty.Combo_Description select new ReferralEscrowDetail() { Escrow_Account = atty.Combo_Description, Referral_Firm = refer.Referral_Firm, Client_Referral_Atty = cltref.Client_Referral_Atty, Client_Name = clt.Client_Name, Period_From = pay.Period_From, Period_To = pay.Period_To, Amount = pay.Amount, Client_Referral = cltref.Client_Referral, Sub_Total = (Double?)pay.Amount * cltref.Client_Referral } ).GroupBy(x => x.Escrow_Account).ToList() }; return(model); }
public virtual async Task OnGet() { var request = await _interaction.GetAuthorizationContextAsync(ReturnUrl); if (request == null) { throw new ApplicationException($"No consent request matching request: {ReturnUrl}"); } var client = await _clientStore.FindEnabledClientByIdAsync(request.ClientId); if (client == null) { throw new ApplicationException($"Invalid client id: {request.ClientId}"); } var resources = await _resourceStore.FindEnabledResourcesByScopeAsync(request.ScopesRequested); if (resources == null || (!resources.IdentityResources.Any() && !resources.ApiResources.Any())) { throw new ApplicationException($"No scopes matching: {request.ScopesRequested.Aggregate((x, y) => x + ", " + y)}"); } ClientInfo = new ClientInfoModel(client); ConsentInput = new ConsentInputModel { RememberConsent = true, IdentityScopes = resources.IdentityResources.Select(x => CreateScopeViewModel(x, true)).ToList(), ApiScopes = resources.ApiResources.SelectMany(x => x.Scopes).Select(x => CreateScopeViewModel(x, true)).ToList() }; if (resources.OfflineAccess) { ConsentInput.ApiScopes.Add(GetOfflineAccessScope(true)); } }
public IMiramarClientInfo LoadClientInfo(int clientId) { using (var connection = new SqlConnection(connectionString)) using (var command = connection.CreateCommand("csp_GlobalApplicationConfigurationLoad")) { command.AddWithValue("@ClientID", clientId) .AddWithValue("@MachineName", Environment.MachineName); if (connection.State != ConnectionState.Open) { connection.Open(); } using (var reader = command.ExecuteReader()) { if (!reader.Read()) { return(null); } var model = new ClientInfoModel { ClientId = clientId, AdminConnection = connectionString, Client = reader.GetString("ClientAbbreviation"), ClientConnection = reader.GetString("ConnectionCsr"), MarketConnection = reader.GetString("ConnectionMarket"), }; return(model); } } }
private ClientInfoModel GetDetailModel(DateTime fromDate, DateTime toDate) { ClientInfoModel model = new ClientInfoModel { DailyDetails = (from clt in db.tblClients join cla in db.tblClaims on clt.id equals cla.Reference_Number join pay in db.tblPayments on cla.Claim_Number equals pay.Claim_Number where pay.Input_Date >= fromDate && pay.Input_Date <= toDate && pay.Posted_Indicator == false select new DailyDetail() { Claim_Number = cla.Claim_Number, Client_Name = clt.Client_Name, Payment_Date = pay.Payment_Date, Handling_Atty = clt.Handling_Atty, Credit_Atty = clt.Credit_Atty, Amount = pay.Amount, Escrow = clt.Escrow, Status_Code = cla.Status_Code, Input_Date = pay.Input_Date } ).ToList() }; return(model); }
public ClientInfoModel GetClientInfo(object identifier) { ClientInfoModel model = null; connectedClientList.TryGetValue(identifier, out model); return(model); }
private ClientInfoModel GetUnmatchedDepositsModel(DateTime fromDate, DateTime toDate) { ClientInfoModel model = new ClientInfoModel { UnmatchedDeposits = (from clt in db.tblClients join cla in db.tblClaims on clt.id equals cla.Reference_Number join pay in db.tblPayments on cla.Claim_Number equals pay.Claim_Number where pay.Input_Date >= fromDate && pay.Input_Date <= toDate && pay.Amount != cla.Payment_Amount orderby cla.Claim_Number select new UnmatchedDeposits() { Input_Date = pay.Input_Date, Claim_Number = cla.Claim_Number, Client_Name = clt.Client_Name, Reference_Number = clt.id, Period_From = pay.Period_From, Period_To = pay.Period_To, Amount = pay.Amount, Payment_Frequency = cla.Payment_Frequency, Payment_Amount = cla.Payment_Amount, Comment = pay.Comment } ).ToList() }; return(model); }
private void InitData() { RequestInfos.Clear(); ReceiveInfos.Clear(); var registryPath = @"SOFTWARE\BIMProduct\BIMProduct2018\Revit2016"; var localMachineRegistry = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, Environment.Is64BitOperatingSystem ? RegistryView.Registry64 : RegistryView.Registry32); ClientInfoModel r1 = new ClientInfoModel() { RName = "ProductNameInEng", RValue = RegistryUtils.ReadRegistryInfo(localMachineRegistry, registryPath, "ProductNameInEng") }; ClientInfoModel r2 = new ClientInfoModel() { RName = "RevitVersion", RValue = RegistryUtils.ReadRegistryInfo(localMachineRegistry, registryPath, "RevitVersion") }; ClientInfoModel r3 = new ClientInfoModel() { RName = "ProductVersion", RValue = RegistryUtils.ReadRegistryInfo(localMachineRegistry, registryPath, "ProductVersion") }; RequestInfos.Add(r1); RequestInfos.Add(r2); RequestInfos.Add(r3); }
// GET: ClientInfo public ActionResult Index() { ClientInfoModel model = new ClientInfoModel { Clients = db.tblClients.OrderByDescending(x => x.id).ToList(), Attys = db.tblAttorneys .ToArray() .Select(c => new ListClass { Id = c.Atty_Initials.ToString(), Name = c.Atty_Name.ToString() }) .ToList() }; User usr = (User)Session["LoggedInUser"]; if (usr.RoleId == "R/O") { return(View("IndexRO", model)); } else { return(View(model)); } }
protected void btnSave_Click(object sender, EventArgs e) { try { var userInfo = new ClientInfoModel(); userInfo.Date = txtDate.Text; userInfo.Code = Convert.ToInt32(txtCode.Text); userInfo.ClientName = txtClientName.Text; userInfo.CompanyName = txtcompanyName.Text; userInfo.ClientContruct = txtClientName.Text; userInfo.ConpanyContruct = txtCompanyNumber.Text; userInfo.Address = txtMainAddress.Text; userInfo.ParnamentAddress = txtParnamentAddress.Text; var isSave = _clientRepository.Save(userInfo); if (isSave) { string successMessage = " Saved Successfully"; lblMessage.Text = successMessage; lblMessage.ForeColor = Color.Green; Refresh(); return; } string failMessage = "Fild Not Saved "; lblMessage.Text = failMessage; } catch (Exception exception) { lblMessage.Text = exception.Message; } }
public override List<string> Do() { ClientInfoModel echoClient = _service.Clients.Where(x => x.Id == _receiveContent.From).FirstOrDefault(); if (echoClient != null) echoClient.EchoTime = DateTime.Now; return strList; }
public override List<string> Do() { ClientInfoModel client = PublicMethod.JsonDeSerialize<ClientInfoModel>(_receiveCmd.Content); client.ConnectTime = DateTime.Now; client.EchoTime = DateTime.Now; _service.Clients.Add(client); strList = _service.SendContentMethod(strList, client.Id, CustomerCommand.Register); return strList; }
public bool RegisterClient(ClientInfoModel clientInfoModel) { //检测服务在线用户数量 ClientList.Add(clientInfoModel); return(true); }
public virtual async Task <IActionResult> OnGetAsync() { var request = await _interaction.GetAuthorizationContextAsync(ReturnUrl); if (request == null) { throw new ApplicationException($"No consent request matching request: {ReturnUrl}"); } var client = await _clientStore.FindEnabledClientByIdAsync(request.Client.ClientId); if (client == null) { throw new ApplicationException($"Invalid client id: {request.Client.ClientId}"); } var resources = await _resourceStore.FindEnabledResourcesByScopeAsync(request.ValidatedResources.RawScopeValues); if (resources == null || !resources.IdentityResources.Any() && !resources.ApiResources.Any()) { throw new ApplicationException( $"No scopes matching: {request.ValidatedResources.RawScopeValues.Aggregate((x, y) => x + ", " + y)}"); } ClientInfo = new ClientInfoModel(client); ConsentInput = new ConsentInputModel { UserName = HttpContext.User.Identity?.Name, RememberConsent = true, IdentityScopes = resources.IdentityResources.Select(x => CreateScopeViewModel(x, true)).ToList(), }; var apiScopes = new List <ScopeViewModel>(); foreach (var parsedScope in request.ValidatedResources.ParsedScopes) { var apiScope = request.ValidatedResources.Resources.FindApiScope(parsedScope.ParsedName); if (apiScope == null) { continue; } var scopeVm = CreateScopeViewModel(parsedScope, apiScope, true); apiScopes.Add(scopeVm); } if (resources.OfflineAccess) { apiScopes.Add(GetOfflineAccessScope(true)); } ConsentInput.ApiScopes = apiScopes; return(Page()); }
private void removeClient(List <string> list) { foreach (string id in list) { ClientInfoModel client = Clients.Where(x => x.Id == id).FirstOrDefault(); if (client != null) { Clients.Remove(client); } } }
/// <summary> /// /// </summary> /// <param name="parameter"></param> /// <returns></returns> private ClientInfoModel OnLoadClientInfo(Object parameter) { ClientInfoModel model = null; if (null != this.SelectedClient) { model = LoadClientModel(this.SelectedClient.Id); } return(model); }
public ResponseMessageData <ClientInfoModel> SaveClient(ClientInfoModel model) { try { return(AppInit.Container.Resolve <IOrderService>().SaveClient(model)); } catch (Exception ex) { SharedLogger.LogError(ex); return(ResponseMessageData <ClientInfoModel> .CreateCriticalMessage("No fue posible almacenar los datos del cliente")); } }
public bool Save(ClientInfoModel CIM) { try { var query = "INSERT INTO tbl_ClientInfo (Date, Code, ClientName,CompanyName,ClientContruct,ConpanyContruct,Address,ParnamentAddress) VALUES('" + CIM.Date + "','" + CIM.Code + "','" + CIM.ClientName + "','" + CIM.CompanyName + "','" + CIM.ClientContruct + "','" + CIM.ConpanyContruct + "','" + CIM.Address + "','" + CIM.ParnamentAddress + "')"; var rowAffected = _databaseCDb.ExecuteNonQuery(query, _connectionString); return(rowAffected > 0); } catch (Exception e) { throw new Exception(e.Message); } }
private ClientInfoModel GetDepositModel(DateTime fromDate, DateTime toDate) { var connection = db.Database.Connection as SqlConnection; connection.Open(); SqlCommand command = new SqlCommand(string.Format("SELECT atty.Combo_Description AS Deposit_Breakdown, ROUND(SUM(pay.Amount * 1), 2) AS Total, ROUND(SUM(pay.Amount * clt.Escrow), 2) AS Escrow, \n" + "ROUND(SUM((pay.Amount - pay.Amount * clt.Escrow) * cnty.County_Value), 2) AS Philadelphia, ROUND(SUM((pay.Amount - pay.Amount * clt.Escrow)\n" + "- (pay.Amount - pay.Amount * clt.Escrow) * cnty.County_Value), 2) AS County\n" + "FROM dbo.tblPayments AS pay INNER JOIN\n" + "dbo.tblClaim AS clm ON pay.Claim_Number = clm.Claim_Number INNER JOIN\n" + "dbo.tblClient AS clt ON clm.Reference_Number = clt.id INNER JOIN\n" + "dbo.tblCounty AS cnty ON clt.County = cnty.County INNER JOIN\n" + "dbo.tblAttyDesc AS atty ON clm.Attorney_Breakdown = atty.Combo_Indicator\n" + "WHERE(pay.Input_Date >= '{0}') AND(pay.Input_Date <= '{1}') AND(pay.Posted_Indicator = 0)\n" + "GROUP BY atty.Combo_Description order by deposit_breakdown", fromDate, toDate), connection); SqlDataReader reader = command.ExecuteReader(); ClientInfoModel model = new ClientInfoModel { DailyDeposits = new List <DailyDeposits>() }; if (reader.HasRows) { while (reader.Read()) { System.Diagnostics.Debug.WriteLine("{0}\t{1}\t{2}\t{3}\t{4}", reader.GetString(0), reader.GetSqlMoney(1), reader.GetDouble(2), reader.GetDouble(3), reader.GetDouble(4)); DailyDeposits dep = new DailyDeposits() { Deposit_Breakdown = reader.GetString(0), Total = (Decimal)reader.GetSqlMoney(1), Escrow = reader.GetDouble(2), Philadelphia = reader.GetDouble(3), County = reader.GetDouble(4) }; model.DailyDeposits.Add(dep); } } reader.Close(); return(model); }
public override void ExecuteCommand(string userId, string command) { ClientLoginCmd data = deserialize.Deserialize <ClientLoginCmd>(command); if (data == null) { return; } /* * // get the login status matches with database * string displayName = string.Empty; * int dbUserId = -1; * DataTable dataTable = Database.DbHelper.GetInstance().ReadData(new User()); * foreach (DataRow dataRow in dataTable.Rows) * { * string username = dataRow[User.USERNAME].ToString(); * string password = dataRow[User.PASSWORD].ToString(); * * if (username.CompareTo(data.Username) == 0 && * password.CompareTo(data.Password) == 0) * { * // found matched username and password * dbUserId = int.Parse(dataRow[User.USER_ID].ToString()); * displayName = dataRow[User.LABEL].ToString(); * break; * } * }*/ List <UserData> userDataList = new List <UserData>(Server.ServerDbHelper.GetInstance().GetAllUsers()); UserData userData = userDataList.Find(user => (user.username.CompareTo(data.Username) == 0 && user.password.CompareTo(data.Password) == 0)); if (userData == null) { // no matched return; } // notify UI ClientInfoModel clientModel = new ClientInfoModel() { DbUserId = userData.id, SocketUserId = userId, Name = userData.name, }; server.ClientLogin(clientModel); }
private ClientInfoModel ClaimsDormantModel(string atty) { ClientInfoModel model = new ClientInfoModel { ClaimsDormant = (from cla in db.qryClaimsDormant2 where ((string.IsNullOrEmpty(atty)) ? 1 == 1 : cla.Handling_Atty == atty) orderby cla.Handling_Atty, cla.Credit_Atty, cla.Client_Name select cla ).ToList() }; return(model); }
private ClientInfoModel ClaimsWithNoPaymentsOver30DaysModel(string atty) { ClientInfoModel model = new ClientInfoModel { ClaimsWithNoPaymentsOver30Days = (from cla in db.qryClaims_30Days2 where ((string.IsNullOrEmpty(atty)) ? 1 == 1 : cla.Handling_Atty == atty) orderby cla.Handling_Atty, cla.Credit_Atty, cla.Client_Name select cla ).ToList() }; return(model); }
public long SaveClient(ClientInfoModel model, bool bIsNew) { var client = bIsNew ? new Entities.Client() : DbEntities.Client.Single(e => e.ClientId == model.ClientId); var phoneToAdd = new ClientPhone { ClientPhoneId = model.PrimaryPhone.PhoneId }; ClientPhone phoneSecToAdd = null; DbEntities.ClientPhone.Attach(phoneToAdd); if (model.SecondPhone != null) { phoneSecToAdd = new ClientPhone { ClientPhoneId = model.SecondPhone.PhoneId }; DbEntities.ClientPhone.Attach(phoneSecToAdd); } for (var i = client.ClientPhone.Count - 1; i >= 0; i--) { var phone = client.ClientPhone.ElementAt(i); client.ClientPhone.Remove(phone); } client.ClientPhone.Add(phoneToAdd); if (phoneSecToAdd != null) { client.ClientPhone.Add(phoneSecToAdd); } client.LoyaltyCode = model.LoyaltyCode; client.BirthDate = model.BirthDate; client.CompanyId = model.CompanyId; client.Email = model.Email; client.FirstName = model.FirstName; client.LastName = model.LastName; if (bIsNew) { client.DatetimeIns = DateTime.Now; DbEntities.Client.Add(client); } DbEntities.SaveChanges(); return(client.ClientId); }
private void ConnectServer() { try { ClientBasicInfo cb = new ClientBasicInfo() { ProductName = RequestInfos.FirstOrDefault(x => string.Equals(x.RName, "ProductNameInEng", StringComparison.OrdinalIgnoreCase))?.RValue, RevitVersion = RequestInfos.FirstOrDefault(x => string.Equals(x.RName, "RevitVersion", StringComparison.OrdinalIgnoreCase))?.RValue, CurrentProductVersion = RequestInfos.FirstOrDefault(x => string.Equals(x.RName, "ProductVersion", StringComparison.OrdinalIgnoreCase))?.RValue }; ClientInfo = cb; DownloadFileInfo df = new DownloadFileInfo(); var result = RequestInfoUtils.RequestDownloadFileInfo(cb, "http://localhost:55756/", "GetFileInfo", "GetInfo", ref df); DownloadInfo = df; if (result) { ClientInfoModel r1 = new ClientInfoModel() { RName = "LatestProductVersion", RValue = df.LatestProductVersion }; ClientInfoModel r2 = new ClientInfoModel() { RName = "DownloadFileMd5", RValue = df.DownloadFileMd5 }; ClientInfoModel r3 = new ClientInfoModel() { RName = "DownloadFileTotalSize", RValue = df.DownloadFileTotalSize.ToString() }; ReceiveInfos.Add(r1); ReceiveInfos.Add(r2); ReceiveInfos.Add(r3); } else { MessageBox.Show("Get DownLoad File Failed!"); } } catch { MessageBox.Show("Get DownLoad File Failed!"); } }
public ActionResult Login(string account, string password) { dynamic data = new System.Dynamic.ExpandoObject(); //动态类型字段 可读可写 var aaaa = CentralizedData.Instance.UserList.Where(x => x.Account == account && x.Password == password).FirstOrDefault(); if (aaaa != null) { data.Id = aaaa.Id; data.Name = aaaa.Name; ClientInfoModel model = new ClientInfoModel(); model.Id = aaaa.Id; model.Name = aaaa.Name; //return Json(new { Success = true, Messages = "登录成功", Data = JsonSerializer.Serialize(model) }); return(Json(new { Success = true, Messages = "登录成功", Data = model })); } return(Json(new { Success = false, Messages = "登录失败" })); }
public ClientInfoModel GetLastCode() { ClientInfoModel _ClientMst = null; string query = "Select top 1 Code from tbl_ClientInfo order by Code desc"; var reader = _databaseCDb.Reader(query, _databaseCDb.ConnectionStrings()); if (reader.HasRows) { reader.Read(); _ClientMst = new ClientInfoModel(); _ClientMst.Code = (Convert.ToInt32(reader["Code"].ToString())); } reader.Close(); return(_ClientMst); }
public ActionResult Save(ClientInfoModel mdl) { tblClient model = mdl.Client; try { if (model.id == 0) { // insert // Insert into table db.tblClients.Add(model); db.SaveChanges(); } else { // update // get original record for unedited fields tblClient record = db.tblClients.Where(x => x.id == model.id).Single(); // transfer form fields record.Client_Name = model.Client_Name; record.Employer_Name = model.Employer_Name; record.Escrow = model.Escrow; record.Handling_Atty = model.Handling_Atty; record.Handling = model.Handling; record.Credit_Atty = model.Credit_Atty; record.Credit = model.Credit; record.County = model.County; record.Accident_Desc = model.Accident_Desc; // Update record db.Entry(record).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } } catch (Exception ex) { return(HandleException(ex)); } // refresh screen return(Content(model.id.ToString())); //Redirect(Request.UrlReferrer.ToString()); }