private void btnSave_Click(object sender, EventArgs e) { SysControlInfo sysControl = new SysControlInfo(); sysControl.IsTakeaway = chkTakeaway.Checked ? "Y" : "N"; sysControl.IsEatIn = chkEatIn.Checked ? "Y" : "N"; sysControl.IsQuickFood = chkQuickFood.Checked ? "Y" : "N"; sysControl.ShopName = txtShopName.Text.Trim(); sysControl.Address = txtAddress.Text.Trim(); sysControl.IsShopDetailReadOnly = chkShopDetailReadOnly.Checked ? "Y" : "N"; sysControl.IsNotAccountFor = chkNotAccountFor.Checked ? "Y" : "N"; sysControl.Key1 = txtKey1.Text.Trim(); sysControl.Key2 = txtKey2.Text.Trim(); sysControl.AccessCode = txtAccessCode.Text.Trim(); sysControl.ImgPath1 = txtImg1.Text.Trim(); sysControl.ImgPath2 = txtImg2.Text.Trim(); sysControl.ImgPath3 = txtImg3.Text.Trim(); sysControl.ImgPath4 = txtImg4.Text.Trim(); sysControl.ImgPath5 = txtImg5.Text.Trim(); if (string.IsNullOrEmpty(sysGuid)) { sysControl.SystemKey = new Guid(Guid.NewGuid().ToString().ToUpper()); _control.AddEntity(sysControl); } else { sysControl.SystemKey = new Guid(sysGuid); _control.UpdateEntity(sysControl); } }
private void FrmSelectMenu_Load(object sender, EventArgs e) { txtDate.Text = DateTime.Now.ToShortDateString(); txtTime.Text = DateTime.Now.ToLongTimeString(); new OnLoadSystemCommonData().GetShiftCodeList(); ShiftCodeInfo scInfo = new ShiftCodeInfo(); scInfo = CommonData.ShiftCodeList.FirstOrDefault(sc => DateTime.Compare(Convert.ToDateTime(DateTime.Now.ToShortTimeString()), Convert.ToDateTime(sc.DtFrom)) >= 0 && DateTime.Compare(Convert.ToDateTime(DateTime.Now.ToShortTimeString()), Convert.ToDateTime(sc.DtTo)) <= 0); if (scInfo != null) { txtSession.Text = scInfo.ShiftName; } txtStaff.Text = userInfo.UsrName; OnLoadSystemCommonData onLoadSystemCommonData = new OnLoadSystemCommonData(); onLoadSystemCommonData.GetSysControlList(); string strImg = ""; if (CommonData.SysControlList.Any()) { sysControlInfo = CommonData.SysControlList.FirstOrDefault(); } else { MessageBox.Show("S001:System data error,Please contact system Administrator!"); Close(); } }