Esempio n. 1
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     var obj = new COLOR();
     obj.COLOR_NAME = popTxtColorTypeName.Text;
     obj.COLOR_SUBNAME = popTxtColorTypeSubName.Text;
     var cmd = new ColorService(obj);
     if (flag.Text.Equals("Add"))
     {
         obj.Action = ActionEnum.Create;
         obj.CREATE_DATE = DateTime.Now;
         obj.CREATE_EMPLOYEE_ID = 0;
         obj.UPDATE_DATE = DateTime.Now;
         obj.UPDATE_EMPLOYEE_ID = 0;
         obj.SYE_DEL = true;
         cmd.Add();
     }
     else
     {
         obj.Action = ActionEnum.Update;
         obj.COLOR_ID = Convert.ToInt32(ViewState["colorId"].ToString());
         obj.UPDATE_DATE = DateTime.Now;
         obj.UPDATE_EMPLOYEE_ID = 0;
         obj.SYE_DEL = true;
         cmd.Edit();
     }
     ViewState["colorId"] = null;
     Response.Redirect("SearchColorProduct.aspx");
 }
Esempio n. 2
0
        private void InitDataPopUp()
        {
            var cmd = new ColorService();
            var list = cmd.GetALL();
            foreach (var item in list)
            {
                ddlColor.Items.Add(new ListItem(item.COLOR_NAME, item.COLOR_ID.ToString()));
            }

            var cmdType = new TraceryService();
            var listType = cmdType.GetALL();
            foreach (var item in listType)
            {
                ddlColorType.Items.Add(new ListItem(item.COLOR_TYPE_NAME, item.COLOR_TYPE_ID.ToString()));
            }

            this.lblProduct.Text = _product.PRODUCT_NAME;
            this.lblTxtProductCode.Text = _product.PRODUCT_CODE;
            this.lblPriceProduct.Text = DataSouceShowProduct.Where(x => x.PRODUCT_ID == _product.PRODUCT_ID).FirstOrDefault().PRICE.ToString();
            this.lblPacking.Text = _product.PRODUCT_PACKING_DESC;
        }
Esempio n. 3
0
 private void InitialDataPopup()
 {
     if (ViewState["colorId"] != null)
     {
         var cmd = new ColorService();
         _color = cmd.Select(Convert.ToInt32(ViewState["colorId"].ToString()));
         if (_color != null)
         {
             popTxtColorTypeName.Text = _color.COLOR_NAME;
             popTxtColorTypeSubName.Text = _color.COLOR_SUBNAME;
             flag.Text = "Edit";
         }
     }
 }
Esempio n. 4
0
 private void InitialData()
 {
     var cmd = new ColorService();
     DataSouce = cmd.GetALL();
     gridColor.DataSource = DataSouce;
     gridColor.DataBind();
 }