Exemplo n.º 1
0
        private void btnCopy_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            mTable = new POS_Floors();
            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;
        }
Exemplo n.º 2
0
        private void btn_AddNew_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            mTable    = new POS_Floors();
            NewRecord = true;
            txtCode.Focus();
            txtCode.Text = string.Empty;
            txtName.Text = string.Empty;
            txtRem.Text  = string.Empty;
            searchLookUpEdit1.EditValue = null;
            ID        = 0;
            img.Image = null;

            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;
        }
Exemplo n.º 3
0
        private void Retrieve(long id)
        {
            mTable = db.POS_Floors.Find(id);
            if (mTable == null)
            {
                btn_AddNew_ItemClick(null, null);
                return;
            }
            NewRecord    = false;
            txtCode.Text = mTable.FloorCode;
            txtName.Text = mTable.FloorName;

            img.Image = null;
            if (mTable.Image != null)
            {
                byte[] ap1 = (byte[])mTable.Image;
                var    ms  = new MemoryStream(ap1);
                img.Image = Image.FromStream(ms);
                ms.Close();
            }

            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();
        }