Beispiel #1
0
        private void setInit()
        {
            txtngaycam.Text         = DateTime.Now.ToString();
            txtkhachhang.Text       = "";
            txtdienthoai.Text       = "";
            txtmota.Text            = "";
            txtgiatrimonhang.Text   = "0";
            txttiencam.Text         = "0";
            txttruhotcon.Text       = "";
            txtmadonthaygiay.Text   = "";
            gridThayGiay.DataSource = null;
            gridGiaoDich._gridGiaoDich.Clear();
            gridtgHistory1.History.Clear();
            gridtgHistory.DataSource = null;
            btntgChuoc.Enabled       = true;
            btntgThayGiay.Enabled    = true;
            btnSave.Enabled          = true;
            btnClear.Enabled         = true;
            btntk1Cancel.Enabled     = true;
            //Thay Giay
            lblSum.Text = "0";
            //
            txttk1loaigiaodich.Items.Clear();
            txttk1loaigiaodich.Items.Add(Constants.CamDo);
            txttk1loaigiaodich.Items.Add(Constants.ThayGiay);
            txttk1loaigiaodich.Items.Add(Constants.ChuocDo);
            txttk1loaigiaodich.Items.Add(Constants.BaoMat);

            //thuchi
            txttcngaynhap.Text = DateTime.Now.ToString();
            cmbtcthuchi.Items.Clear();
            cmbtcthuchi.Items.Add(Constants.Thu);
            cmbtcthuchi.Items.Add(Constants.Chi);

            //Cau Hinh
            Model.camdochieuduongEntities camdochieuduongEntity = new Model.camdochieuduongEntities();
            Model.CauHinh CH = camdochieuduongEntity.CauHinhs.Find(Constants.CamDo);
            txtchlaitren10tr.Text  = CH.LaiTren10Tr.ToString();
            txtchlaiduoi10tr.Text  = CH.LaiDuoi10Tr.ToString();
            txtchsongayapdung.Text = CH.SoNgayApDung.ToString();
            txtchsongaytoihan.Text = CH.SoNgayToiHan.ToString();
        }
Beispiel #2
0
 private void btnSaveConfig_Click(object sender, EventArgs e)
 {
     Model.camdochieuduongEntities camdochieuduongEntity = new Model.camdochieuduongEntities();
     Model.CauHinh CH = camdochieuduongEntity.CauHinhs.Find(Constants.CamDo);
     if (CH == null)
     {
         CH.Type         = Constants.CamDo;
         CH.LaiTren10Tr  = Convert.ToInt64(txtchlaitren10tr.Text);
         CH.LaiDuoi10Tr  = Convert.ToInt64(txtchlaiduoi10tr.Text);
         CH.SoNgayApDung = Convert.ToInt16(txtchsongayapdung.Text);
         CH.SoNgayToiHan = Convert.ToInt16(txtchsongaytoihan.Text);
         camdochieuduongEntity.CauHinhs.Add(CH);
     }
     else
     {
         CH.LaiTren10Tr  = Convert.ToDecimal(txtchlaitren10tr.Text);
         CH.LaiDuoi10Tr  = Convert.ToDecimal(txtchlaiduoi10tr.Text);
         CH.SoNgayApDung = Convert.ToInt16(txtchsongayapdung.Text);
         CH.SoNgayToiHan = Convert.ToInt16(txtchsongaytoihan.Text);
     }
     camdochieuduongEntity.SaveChanges();
     MessageBox.Show("Lưu Xong");
 }