Example #1
0
        private void FrmSysCtl_Load(object sender, EventArgs e)
        {
            OnLoadSystemCommonData onLoadSystemCommonData = new OnLoadSystemCommonData();

            onLoadSystemCommonData.GetSysControlList();

            if (CommonData.SysControlList.Count > 0)
            {
                var qList = CommonData.SysControlList.FirstOrDefault();
                sysGuid              = qList.SystemKey.ToString();
                chkTakeaway.Checked  = qList.IsTakeaway.Equals("Y");
                chkEatIn.Checked     = qList.IsEatIn.Equals("Y");
                chkQuickFood.Checked = qList.IsQuickFood.Equals("Y");

                txtShopName.Text = qList.ShopName;
                txtAddress.Text  = qList.Address;
                chkShopDetailReadOnly.Checked = qList.IsShopDetailReadOnly.Equals("Y");
                chkNotAccountFor.Checked      = qList.IsNotAccountFor.Equals("Y");
                txtKey1.Text       = qList.Key1;
                txtKey2.Text       = qList.Key2;
                txtAccessCode.Text = qList.AccessCode;
                txtImg1.Text       = qList.ImgPath1;
                txtImg2.Text       = qList.ImgPath2;
                txtImg3.Text       = qList.ImgPath3;
                txtImg4.Text       = qList.ImgPath4;
                txtImg5.Text       = qList.ImgPath5;
            }
            else
            {
                //sysGuid = Guid.NewGuid().ToString().ToUpper();
                chkTakeaway.Checked  = false;
                chkEatIn.Checked     = false;
                chkQuickFood.Checked = false;

                txtShopName.Text = "";
                txtAddress.Text  = "";
                chkShopDetailReadOnly.Checked = false;
                chkNotAccountFor.Checked      = false;
                txtKey1.Text       = "";
                txtKey2.Text       = "";
                txtAccessCode.Text = "";
                txtImg1.Text       = "";
                txtImg2.Text       = "";
                txtImg3.Text       = "";
                txtImg4.Text       = "";
                txtImg5.Text       = "";
            }
        }
Example #2
0
        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();
            }
        }