Esempio n. 1
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     var obj = new ZONE();
     obj.ZONE_CODE = popTxtZoneCode.Text;
     obj.ZONE_NAME = popTxtZoneName.Text;
     var cmd = new ZoneService(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.ZONE_ID = Convert.ToInt32(ViewState["zoneID"].ToString());
         obj.UPDATE_DATE = DateTime.Now;
         obj.UPDATE_EMPLOYEE_ID = 0;
         obj.SYE_DEL = true;
         cmd.Edit();
     }
     flag.Text = "Add";
     ViewState["zoneID"] = null;
     Response.Redirect("SearchZone.aspx");
 }
Esempio n. 2
0
 public ZoneService(ZONE item)
 {
     _item = item;
 }
Esempio n. 3
0
        private void InitialDataPopup()
        {
            var cmdEmp = new EmployeeService();
            foreach (var item in cmdEmp.GetALLInclude())
            {
                ddlSell.Items.Add(new ListItem(("แผนก " + item.DEPARTMENT.DEPARTMENT_NAME + " ชื่อ " + item.EMPLOYEE_NAME + " " + item.EMPLOYEE_SURNAME), item.EMPLOYEE_ID.ToString()));
            }

            if (ViewState["zoneID"] != null)
            {
                var cmd = new ZoneService();
                _zone = cmd.Select(Convert.ToInt32(ViewState["zoneID"].ToString()));
                if (_zone != null)
                {
                    popTxtZoneCode.Text = _zone.ZONE_CODE;
                    popTxtZoneName.Text = _zone.ZONE_NAME;
                    flag.Text = "Edit";
                }
            }
        }
Esempio n. 4
0
 public List<ZONE> GetALL(ZONE item)
 {
     using (var ctx = new SPWEntities())
     {
         var list = ctx.ZONE.Where(x => x.ZONE_CODE.Contains(item.ZONE_CODE)).ToList();
         return list;
     }
 }