예제 #1
0
        protected void deleteInfo_Click(object sender, Ext.Net.DirectEventArgs e)
        {
            string data = e.ExtraParams["data"];

            System.Web.Script.Serialization.JavaScriptSerializer    Serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
            List <BusinessLogic.ManageCustomerService.XMWorkerInfo> list       = Serializer.Deserialize <List <BusinessLogic.ManageCustomerService.XMWorkerInfo> >(data);

            if (list.Count <= 0)
            {
                Ext.Net.ExtNet.Msg.Alert("提示", "请选择一条数据").Show();
            }

            int ID = list[0].ID;

            BusinessLogic.ManageCustomerService.XMWorkerInfo entity = XMWorkerInfoService.getSingle(a => a.ID == ID);
            if (entity == null)
            {
                ExtNet.Msg.Alert("提示", "记录不存在!").Show();
                return;
            }

            entity.IsEnable = true;

            XMWorkerInfoService.UpdateXMWorkerInfo(entity);
        }
예제 #2
0
        protected void btnEdit_Click(object sender, Ext.Net.DirectEventArgs e)
        {
            int    ID               = int.Parse(txtID.Text);
            string fullName         = txtName.Text.Trim();
            string tel              = txtTel.Text.Trim();
            string level            = txtLevel.Text.Trim();
            string PayMethod        = txtPayMethod.Text.Trim();
            string InstallationType = txtInstallationType.Text.Trim();
            string province         = "";

            foreach (var item in cbProvince.SelectedItems)
            {
                province = province + item.Text + ",";
            }
            if (!string.IsNullOrEmpty(province))
            {
                province = province.Substring(0, province.Length - 1);
            }
            string city = "";

            foreach (var item in cbCity.SelectedItems)
            {
                city = city + item.Text + ",";
            }
            if (!string.IsNullOrEmpty(city))
            {
                city = city.Substring(0, city.Length - 1);
            }
            string regin = "";

            foreach (var item in cbRegion.SelectedItems)
            {
                regin = regin + item.Text + ",";
            }
            if (!string.IsNullOrEmpty(regin))
            {
                regin = regin.Substring(0, regin.Length - 1);
            }

            BusinessLogic.ManageCustomerService.XMWorkerInfo entity = XMWorkerInfoService.getSingle(a => a.ID == ID);
            if (entity == null)
            {
                ExtNet.Msg.Alert("提示", "记录不存在!").Show();
                return;
            }

            entity.FullName         = fullName;
            entity.Tel              = tel;
            entity.LevelType        = level;
            entity.PayMethod        = PayMethod;
            entity.InstallationType = InstallationType;
            entity.Province         = province;
            entity.City             = city;
            entity.Regin            = regin;
            entity.CreateID         = HozestERPContext.Current.User.CustomerID;
            entity.CreateTime       = DateTime.Now;
            entity.UpdateID         = HozestERPContext.Current.User.CustomerID;
            entity.UpdateTime       = DateTime.Now;

            XMWorkerInfoService.UpdateXMWorkerInfo(entity);
        }