protected void edit_Click(object sender, DirectEventArgs e) { string data = e.ExtraParams["data"]; System.Web.Script.Serialization.JavaScriptSerializer Serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); List <XMLogisticsFeeMainNew> list = Serializer.Deserialize <List <XMLogisticsFeeMainNew> >(data); if (list.Count <= 0) { Ext.Net.ExtNet.Msg.Alert("提示", "你没有选择任何记录").Show(); return; } else if (list.Count > 1) { Ext.Net.ExtNet.Msg.Alert("提示", "只允许单选").Show(); return; } data_Bind(); Window1.Show(); fromPanel1.Reset(); BusinessLogic.ManageProject.XMLogisticsFeeMain entity = XMLogisticsFeeMainService.GetXMLogisticsFeeMainByID(list[0].ID); selectID.Value = list[0].ID; cbProject.Value = entity.ProjectID; cbWarehouse.Value = entity.WareHouseID; cbProvince.Value = entity.Province; cbCity.Value = entity.City; cbArea.Value = entity.Area; cbLogistics.Value = entity.LogisticsID; numPrice.Value = entity.Fee; btnEdit.Hidden = false; btnSave.Hidden = true; }
protected void btnEdit_Click(object sender, DirectEventArgs e) { int ID = int.Parse(selectID.Text); BusinessLogic.ManageProject.XMLogisticsFeeMain entity = XMLogisticsFeeMainService.GetXMLogisticsFeeMainByID(ID); entity.ProjectID = int.Parse(cbProject.Text); entity.WareHouseID = int.Parse(cbWarehouse.Text); entity.Province = cbProvince.Text; entity.City = cbCity.Text; entity.Area = cbArea.Text; entity.LogisticsID = int.Parse(cbLogistics.Text); entity.Fee = decimal.Parse(numPrice.Text); XMLogisticsFeeMainService.UpdateXMLogisticsFeeMain(entity); }