Beispiel #1
0
 private void getModel(string guid)
 {
     if (guid != "")
     {
         InsuranceAndReviewModel model = this.IARBLL.GetModel(new Guid(guid));
         if (model != null)
         {
             this.hideIARGUID.Value = guid;
             this.txtcode.Text      = model.code;
             if (model.code != "")
             {
                 if (model.Type == 0)
                 {
                     this.rado.Items[0].Selected = true;
                 }
                 else
                 {
                     this.rado.Items[1].Selected = true;
                 }
             }
             this.txtDate.Text = ((model.Date == null) ? "" : DateTime.Parse(model.Date.ToString()).ToShortDateString());
             MainBLL mainBLL = new MainBLL();
             if (mainBLL.Exists(new Guid(model.VehicleCode.ToString())))
             {
                 this.Hidden_save_SID.Value = model.VehicleCode.ToString();
             }
         }
     }
 }
Beispiel #2
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(this.hfldContractTypeGuid.Value))
     {
         List <string> list = new List <string>();
         if (this.hfldContractTypeGuid.Value.Contains("["))
         {
             list = JsonHelper.GetListFromJson(this.hfldContractTypeGuid.Value);
         }
         else
         {
             list.Add(this.hfldContractTypeGuid.Value);
         }
         if (list.Count > 0)
         {
             for (int i = 0; i < list.Count; i++)
             {
                 List <TypeAndState> modelList = this.TASBLL.GetModelList("ParentGuid='" + new Guid(list[i].ToString()) + "'");
                 if (this.TASBLL.GetModel(new Guid(list[i].ToString())).ParentGuid.ToString() == default(Guid).ToString() && modelList.Count > 0)
                 {
                     StringBuilder stringBuilder = new StringBuilder();
                     stringBuilder.Append("alert('系统提示:\\n\\n 类型正在使用!');").Append(Environment.NewLine);
                     base.RegisterScript(stringBuilder.ToString());
                     break;
                 }
                 MainBLL mainBLL = new MainBLL();
                 if (mainBLL.Exists(string.Concat(new string[]
                 {
                     "VehicleType='",
                     list[i].ToString(),
                     "' or State='",
                     list[i].ToString(),
                     "'"
                 })))
                 {
                     StringBuilder stringBuilder2 = new StringBuilder();
                     stringBuilder2.Append("alert('系统提示:\\n\\n 类型正在使用!');").Append(Environment.NewLine);
                     base.RegisterScript(stringBuilder2.ToString());
                     break;
                 }
                 this.TASBLL.Delete(new Guid(list[i].ToString()));
             }
             this.DataBindContractType();
             this.DataBindProject();
             this.KeepTreeViewState();
         }
     }
 }