Exemple #1
0
 public void EditItem(int id)
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         _action     = "EDIT";
         FillControl.FillWarehouseInoutType(cboInoutType, 0, false, true);
         modWarehouseInoutForm mod = _dal.GetItem(id, out Util.emsg);
         if (mod != null)
         {
             txtId.Text                 = id.ToString();
             dtpInoutDate.Value         = mod.InoutDate;
             cboInoutType.SelectedValue = mod.InoutType;
             txtNo.Text                 = mod.No;
             txtProductId.Text          = mod.ProductId;
             txtProductName.Text        = mod.ProductName;
             txtSize.Text               = mod.Size.ToString();
             txtQty.Text                = mod.Qty.ToString();
             txtWarehouseId.Text        = mod.WarehouseId.ToString();
             txtRemark.Text             = mod.Remark;
             if (mod.Status == 1)
             {
                 status4.Image = Properties.Resources.audited;
                 Util.ChangeStatus(this, true);
                 toolSave.Enabled = false;
             }
             else
             {
                 status4.Image    = null;
                 toolSave.Visible = true;
                 Util.ChangeStatus(this, false);
                 txtId.ReadOnly   = true;
                 toolSave.Enabled = true;
             }
             dalProductList dalpdt = new dalProductList();
             modProductList modpdt = dalpdt.GetItem(mod.ProductId, out Util.emsg);
             if (modpdt.SizeFlag == 1)
             {
                 txtSize.Enabled = true;
             }
             else
             {
                 txtSize.Enabled = false;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Exemple #2
0
 public void AddItem(string acctype)
 {
     _action = "NEW";
     FillControl.FillWarehouseInoutType(cboInoutType, 0, false, false);
     cboInoutType.SelectedIndex = -1;
     txtId.Text         = "0";
     dtpInoutDate.Value = DateTime.Today;
     if (dtpInoutDate.Value > Util.modperiod.EndDate)
     {
         dtpInoutDate.Value = Util.modperiod.EndDate;
     }
     txtSize.Text        = "1";
     txtWarehouseId.Text = clsLxms.GetDefaultWarehouseId();
     status4.Image       = null;
 }