public override string ToString() { var sb = new StringBuilder(base.ToString()); sb.Append("|").Append(CommentOverrideDateTime.IsNull ? CommentOverrideDateTime.ToString() : CommentOverrideDateTime.Value.ToString("G")); return(sb.ToString()); }
public override string ToString() { var sb = new StringBuilder(base.ToString()).Append("|").Append(ItemNumber.ToString()).Append("|"); sb.Append(WeekEndDate.IsNull ? WeekEndDate.ToString() : WeekEndDate.Value.ToString("MM/dd/yyyy")); return(sb.ToString()); }
public static void IdentityII(SqlInt32 accoutId, SqlString deliveryTablePrefix, SqlDateTime identity1Timestamp, SqlString identityConfig) { using (var objectsConnection = new SqlConnection("context connection=true")) { objectsConnection.Open(); var identityMng = new IdentityManager(objectsConnection); // pass all delivery parameters as parameters to SP identityMng.AccountId = Convert.ToInt32(accoutId.ToString()); identityMng.TablePrefix = deliveryTablePrefix.ToString(); identityMng.ConfigXml = identityConfig.ToString(); identityMng.TransformTimestamp = Convert.ToDateTime(identity1Timestamp.ToString()); identityMng.Log(string.Format("Starting Identity II, parameters: accountId={0}, delivery table prefix='{1}', identity I timestamp={2}, identity config={3}", accoutId, deliveryTablePrefix, identityMng.TransformTimestamp.ToString("dd/MM/yyyy HH:mm:ss"), identityMng.ConfigXml)); try { identityMng.UpdateEdgeObjects(); } catch (System.Exception ex) { // TODO: write to log in DB throw; } } }
public override string ToString() { var sb = new StringBuilder(base.ToString()).Append("|").Append(ItemNumber.ToString()).Append("|"); sb.Append(Month.IsNull ? Month.ToString() : Month.Value.ToString("MM/dd/yyyy")); return(sb.ToString()); }
public override string ToString() { var sb = new StringBuilder(base.ToString()).Append("|"); sb.Append(POSSalesEndDate.IsNull ? POSSalesEndDate.ToString() : POSSalesEndDate.Value.ToString("MM/dd/yyyy")); return(sb.ToString()); }
public static bool ProveriZaIf(string id, SqlDateTime vreme, int i) { string spojeno = id + vreme.ToString(); bool retVal = true; Dictionary <string, List <CalculationTable> > p = proxyProveriPreInserta.PosaljiInsert(); foreach (var item in p) { foreach (var item2 in item.Value) { if (i == 1 && item.Key == "AVG" && (item2.Id + item2.PoslednjeVreme.ToString().ToString()) == spojeno) { retVal = false; break; } else if (i == 2 && item.Key == "MAX" && (item2.Id + item2.PoslednjeVreme.ToString().ToString()) == spojeno) { retVal = false; break; } else if (i == 3 && item.Key == "MIN" && (item2.Id + item2.PoslednjeVreme.ToString().ToString()) == spojeno) { retVal = false; break; } } } return(retVal); }
private void SetSearchCriteria() { DateTime fromDate = DateTime.Parse(txtFromDate.Text); DateTime toDate = DateTime.Parse(txtToDate.Text); SqlDateTime sFromDate = Utility.GetSqlDateTimeFromDateTime(fromDate); SqlDateTime sToDate = Utility.GetSqlDateTimeFromDateTime(toDate); SqlInt32 numAdults = SqlInt32.Parse(drpNumberOfAdults.SelectedValue); SqlInt32 numKids = SqlInt32.Parse(drpNumberOfChildren.SelectedValue); this.FromDate = sFromDate; this.hidFromDate.Value = sFromDate.ToString(); this.ToDate = sToDate; this.hidToDate.Value = sToDate.ToString(); this.NumAdults = numAdults; this.hidNumberOfAdults.Value = numAdults.ToString(); this.NumKids = numKids; this.hidNumberOfChildren.Value = numKids.ToString(); SqlInt32 numRooms = SqlInt32.Parse(this.hidNumberOfAdults.Value) + SqlInt32.Parse(this.hidNumberOfChildren.Value); this.NumRooms = numRooms; Session.Add("FromDate", sFromDate); Session.Add("ToDate", sToDate); Session.Add("NumAdults", numAdults); Session.Add("NumKids", numKids); Session.Add("NumRooms", numRooms); }
public static SqlString FN_FORMATDATE(SqlDateTime FLD_VAL, SqlInt32 EXP_LEN, SqlString FLD_NAME, SqlString REC_TYPE, SqlString X02_KEY) { if (FLD_VAL.IsNull) { return("00000000"); } DateTime Date = Convert.ToDateTime(FLD_VAL.ToString()); string Date1 = Date.ToString("yyyyMMdd").Replace("-", "").Replace("/", ""); if (Date1.Length == 8) { return(Date1.Substring(0, 8)); } if (FLD_VAL.ToString().Length == (int)EXP_LEN) { return(FLD_VAL.ToString()); } return(new NotImplementedException().ToString()); }
public void ToStringTest() { // // Thanks for Marting Baulig for these (DateTimeTest.cs) // SqlDateTime t1 = new SqlDateTime(2002, 2, 25, 5, 25, 13); SqlDateTime t2 = new SqlDateTime(2002, 2, 25, 15, 25, 13); // Standard patterns Assert.AreEqual("2/25/2002 5:25:13 AM", t1.ToString(), "L01"); Assert.AreEqual((SqlString)"2/25/2002 5:25:13 AM", t1.ToSqlString(), "L02"); }
/// <summary> /// Convert the value of SqlDateTime to string /// </summary> /// <param name="o"></param> /// <returns></returns> public static string SqlToString(SqlDateTime o) { string val; if (o.IsNull) { val = ""; } else { val = o.ToString(); } return(val); }
public bool ProveriZaIf(string id, SqlDateTime vreme, int i) { if (String.IsNullOrEmpty(id)) { throw new ArgumentNullException(); } if (vreme > DateTime.Now) { throw new VremeException(); } if (i < 1 || i > 3) { throw new ArgumentOutOfRangeException(); } bool retVal = true; string spojeno = id + vreme.ToString(); Dictionary <string, List <CalculationTable> > proxyLista = proxyProveriPreInserta.PosaljiInsert(); foreach (var item in proxyLista) { foreach (var item2 in item.Value) { if (i == 1 && item.Key == "AVG" && (item2.Id + item2.PoslednjeVreme.ToString().ToString()) == spojeno) { retVal = false; break; } else if (i == 2 && item.Key == "MAX" && (item2.Id + item2.PoslednjeVreme.ToString().ToString()) == spojeno) { retVal = false; break; } else if (i == 3 && item.Key == "MIN" && (item2.Id + item2.PoslednjeVreme.ToString().ToString()) == spojeno) { retVal = false; break; } } } return(retVal); }
/// <summary> /// /// </summary> /// <returns></returns> public override string ToString() { return(_sql.ToString()); }
protected override string uc_Update() { string str; if (MyRule.Get(MyLogin.RoleId, "bbiContract") != "OK") { str = ""; } else if (MyRule.AllowEdit) { // SYS_LOG.Insert("Hợp Đồng Lao Động", "Cập Nhật", this.txtContractCode.Text); base.SetWaitDialogCaption("Đang cập nhật dữ liệu..."); HRM_CONTRACT hRMCONTRACT = new HRM_CONTRACT(); hRMCONTRACT = this.InitClass(); string str1 = hRMCONTRACT.Update(); if (str1 == "OK") { this.RaiseSuccessEventHander(hRMCONTRACT); } if (!(str1 != "OK")) { HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE(); hRMEMPLOYEE.Get(this.glkEmployeeCode.EditValue.ToString()); if (hRMEMPLOYEE.ContractCode == this.txtContractCode.Text) { hRMEMPLOYEE.ContractCode = this.txtContractCode.Text; hRMEMPLOYEE.ContractType = this.cboContractType.Text; hRMEMPLOYEE.ContractSignDate = this.dtFromDate.DateTime; hRMEMPLOYEE.ContractFromDate = this.dtFromDate.DateTime; if (this.cboContractType.SelectedIndex != 1) { hRMEMPLOYEE.ContractToDate = this.dtToDate.DateTime; } else { SqlDateTime maxValue = SqlDateTime.MaxValue; hRMEMPLOYEE.ContractToDate = Convert.ToDateTime(maxValue.ToString()); } if (hRMEMPLOYEE.PayForm == 1) { hRMEMPLOYEE.PayMoney = decimal.Parse(this.calBasicSalary.EditValue.ToString()); hRMEMPLOYEE.BasicSalary = hRMEMPLOYEE.PayMoney; hRMEMPLOYEE.InsuranceSalary = hRMEMPLOYEE.PayMoney; hRMEMPLOYEE.DateSalary = this.dtSignDate.DateTime; } hRMEMPLOYEE.Update(); } } else { XtraMessageBox.Show(str1, "Cảnh Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } this.DoHide(); str = str1; } else { MyRule.Notify(); str = ""; } return(str); }
public string getDateString() { return(dateOfMessage.ToString()); }
public override string ToString() => _sql.ToString();
private HRM_CONTRACT InitClass() { HRM_CONTRACT hRMCONTRACT; HRM_CONTRACT str = new HRM_CONTRACT() { ContractCode = this.txtContractCode.Text }; if (this.glkEmployeeCode.EditValue == null) { XtraMessageBox.Show("Vui lòng chọn nhân viên cần tạo hợp đồng!"); hRMCONTRACT = null; } else { str.EmployeeCode = this.glkEmployeeCode.EditValue.ToString(); if (!(this.txtContractCode.Text == "")) { str.ContractType = this.cboContractType.SelectedIndex; str.ContractTime = this.cboContractTime.Text; str.SignDate = this.dtSignDate.DateTime; str.FromDate = this.dtFromDate.DateTime; if (this.cboContractType.SelectedIndex != 1) { str.ToDate = this.dtToDate.DateTime; } else { SqlDateTime maxValue = SqlDateTime.MaxValue; str.ToDate = Convert.ToDateTime(maxValue.ToString()); } str.BasicSalary = decimal.Parse(this.calBasicSalary.EditValue.ToString()); str.PayForm = this.cboPayForm.Text; str.PayDate = this.txtPayDate.Text; str.Allowance = this.txtAllowance.Text; str.Insurance = this.txtInsurance.Text; str.WorkTime = this.txtWorkTime.Text; str.Compensation = decimal.Parse(this.calCompensation.EditValue.ToString()); str.Signer = this.txtSigner.Text; str.SignerPosition = this.txtSignerPosition.Text; str.SignerNationality = this.txtSignerNationality.Text; str.Company = this.txtCompany.Text; str.Address = this.txtAddress.Text; str.Tel = this.txtTel.Text; str.CreatePlace = this.txtCreatePlace.Text; str.Subject = this.txtSubject.Text; str.Description = this.txtDescription.Text; if (!this.chxIsCurrent.Checked) { str.IsCurrent = false; } else { str.IsCurrent = true; } hRMCONTRACT = str; } else { XtraMessageBox.Show("Vui lòng nhập mã hợp đồng!"); hRMCONTRACT = null; } } return(hRMCONTRACT); }
public static String GetSqlCompliantDate(DateTime dateTime) { SqlDateTime sqlDateTime = new SqlDateTime(dateTime); return(sqlDateTime.ToString()); }
public static string Dayname(SqlDateTime d) { return(d.ToString()); }
protected override string uc_Save() { string str; if (MyRule.Get(MyLogin.RoleId, "bbiContract") != "OK") { str = ""; } else if (!MyRule.AllowAdd) { MyRule.Notify(); str = ""; } else if ((this.txtContractCode.ErrorText != string.Empty ? false : !(this.glkEmployeeCode.ErrorText != string.Empty))) { // SYS_LOG.Insert("Hợp Đồng Lao Động", "Thêm", this.txtContractCode.Text); Cursor.Current = Cursors.WaitCursor; HRM_CONTRACT hRMCONTRACT = new HRM_CONTRACT(); HRM_CONTRACT hRMCONTRACT1 = this.InitClass(); hRMCONTRACT = hRMCONTRACT1; if (hRMCONTRACT1 != null) { base.SetWaitDialogCaption("Đang lưu dữ liệu..."); string str1 = hRMCONTRACT.Insert(); if (str1 == "OK") { this.RaiseSuccessEventHander(hRMCONTRACT); } Cursor.Current = Cursors.Default; if (!(str1 != "OK")) { HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE(); hRMEMPLOYEE.Get(this.glkEmployeeCode.EditValue.ToString()); HRM_PROCESS_SALARY hRMPROCESSSALARY = new HRM_PROCESS_SALARY() { SalaryID = Guid.NewGuid(), EmployeeCode = hRMEMPLOYEE.EmployeeCode, OldPayForm = hRMEMPLOYEE.PayForm, OldPayMoney = hRMEMPLOYEE.PayMoney, OldRankSalary = hRMEMPLOYEE.RankSalary, OldStepSalary = hRMEMPLOYEE.StepSalary, OldCoefficientSalary = hRMEMPLOYEE.CoefficientSalary, OldMinimumSalary = hRMEMPLOYEE.MinimumSalary, OldBasicSalary = hRMEMPLOYEE.BasicSalary, OldInsuranceSalary = hRMEMPLOYEE.InsuranceSalary, NewPayForm = 1, NewPayMoney = decimal.Parse(this.calBasicSalary.EditValue.ToString()), NewRankSalary = hRMEMPLOYEE.RankSalary, NewStepSalary = hRMEMPLOYEE.StepSalary, NewCoefficientSalary = hRMEMPLOYEE.CoefficientSalary, NewMinimumSalary = hRMEMPLOYEE.MinimumSalary, NewBasicSalary = decimal.Parse(this.calBasicSalary.EditValue.ToString()), NewInsuranceSalary = decimal.Parse(this.calBasicSalary.EditValue.ToString()), Date = this.dtSignDate.DateTime, Reason = "Ký mới hợp đồng lao động", Person = this.txtSigner.Text }; hRMPROCESSSALARY.Insert(); hRMEMPLOYEE.ContractCode = this.txtContractCode.Text; hRMEMPLOYEE.ContractType = this.cboContractType.Text; hRMEMPLOYEE.ContractSignDate = this.dtFromDate.DateTime; hRMEMPLOYEE.ContractFromDate = this.dtFromDate.DateTime; if (this.cboContractType.SelectedIndex != 1) { hRMEMPLOYEE.ContractToDate = this.dtToDate.DateTime; } else { SqlDateTime maxValue = SqlDateTime.MaxValue; hRMEMPLOYEE.ContractToDate = Convert.ToDateTime(maxValue.ToString()); } if (hRMEMPLOYEE.PayForm == 1) { hRMEMPLOYEE.PayMoney = decimal.Parse(this.calBasicSalary.EditValue.ToString()); hRMEMPLOYEE.BasicSalary = hRMEMPLOYEE.PayMoney; hRMEMPLOYEE.InsuranceSalary = hRMEMPLOYEE.PayMoney; hRMEMPLOYEE.DateSalary = this.dtSignDate.DateTime; } hRMEMPLOYEE.Update(); } else { XtraMessageBox.Show(str1, "Cảnh Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } this.DoHide(); str = str1; } else { str = "FALSE"; } } else { MessageBox.Show("Mã hợp đồng hoặc mã nhân viên không được trùng!", "Cảnh Báo"); str = ""; } return(str); }