Example #1
0
        private void Retrieve(long id)
        {
            mTable = db.POS_Kitchens.Find(id);
            if (mTable == null)
            {
                btn_AddNew_ItemClick(null, null);
                return;
            }
            NewRecord    = false;
            txtCode.Text = mTable.KitchenCode;
            txtName.Text = mTable.KitchenName;
            chkKitchenHavePrinter.Checked = mTable.KitchenHavePrinter == null ? false : (bool)mTable.KitchenHavePrinter;
            chkKitchenHaveScreen.Checked  = mTable.KitchenHaveScreen == null ? false : (bool)mTable.KitchenHaveScreen;
            cmbPrinter.Text = mTable.PrinterName;


            var user = db.Users.FirstOrDefault(c => c.ID == mTable.UserCreate && c.Branch_ID == Settings.CurrentBranch_ID);

            lblUserCreate.Text     = user.UserName;
            lblUserCreateDate.Text = mTable.CreationDate.ToString();
            user = db.Users.FirstOrDefault(c => c.ID == mTable.UserLastModified && c.Branch_ID == Settings.CurrentBranch_ID);
            if (user != null)
            {
                lblUserLastModified.Text = user.UserName;
            }
            else
            {
                lblUserLastModified.Text = "";
            }
            lbllblUserLastModifiedDate.Text = mTable.LastModified.ToString();
        }
Example #2
0
        private void btnCopy_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            mTable = new POS_Kitchens();
            txtCode.Focus();
            txtCode.SelectAll();
            NewRecord = true;
            ID        = 0;

            var user = db.Users.FirstOrDefault(c => c.ID == Settings.CurrentUser_ID && c.Branch_ID == Settings.CurrentBranch_ID);

            lblUserCreate.Text              = user.UserName;
            lblUserCreateDate.Text          = DateTime.Now.ToString();
            lblUserLastModified.Text        = string.Empty;
            lbllblUserLastModifiedDate.Text = string.Empty;
        }
Example #3
0
        private void btn_AddNew_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            mTable    = new POS_Kitchens();
            NewRecord = true;
            txtCode.Focus();
            txtCode.Text    = string.Empty;
            txtName.Text    = string.Empty;
            txtRem.Text     = string.Empty;
            cmbPrinter.Text = string.Empty;
            chkKitchenHaveScreen.Checked = false;
            searchLookUpEdit1.EditValue  = null;
            ID = 0;


            var user = db.Users.FirstOrDefault(c => c.ID == Settings.CurrentUser_ID && c.Branch_ID == Settings.CurrentBranch_ID);

            lblUserCreate.Text              = user.UserName;
            lblUserCreateDate.Text          = DateTime.Now.ToString();
            lblUserLastModified.Text        = string.Empty;
            lbllblUserLastModifiedDate.Text = string.Empty;
        }