예제 #1
0
파일: Add.aspx.cs 프로젝트: uwitec/ds568
 private void Button1_Click(object sender, EventArgs e) {
     try {
         string pname = cname.Value.Trim();
         if (string.IsNullOrEmpty(pname)) {
             Common.MessageBox.Show(this,"属性名称不能为空",Common.MessageBox.InfoType.warning);
             return;
         }
         if (DropDownList2.Items.Count.Equals(0))
         {
             Common.MessageBox.Show(this, "映射序号已用完,不能继续添加", Common.MessageBox.InfoType.warning);
             return;
         }
         var bl = new DS_Property_Br();
         var md = bl.CreateModel();
         md.ProName = pname;
         md.SysCatID = int.Parse(Request.QueryString["SysCatID"]);
         md.ControlType =byte.Parse(DropDownList1.SelectedIndex.ToString());
         md.Unit = unit.Value.Trim();
         md.MapID =byte.Parse(DropDownList2.SelectedValue);
         md.Request = CheckBox1.Checked;
         md.Px = 0;
         bl.Add(md);
         bl.Sort(md.ID,true);
         Common.MessageBox.Show(this, "保存成功", Common.MessageBox.InfoType.info, "function(){location='list.aspx?SysCatID="+md.SysCatID+"'}");
     }catch(Exception ex){
         Common.WriteLog.SetErrLog(Request.Url.ToString(), "Button1_Click", ex.Message);
         if (ex.Message.Contains("IX_DS_Property")) {
             Common.MessageBox.Show(this, "已存在相同的分类名称", Common.MessageBox.InfoType.error);
             return;
         }
         Common.MessageBox.Show(this, "保存发生意外,请联系管理人员解决。"+ex.Message, Common.MessageBox.InfoType.error);
     }
 }
예제 #2
0
    protected void LinkButtonPx_Click(object sender, EventArgs e)
    {
        var lb = (LinkButton)sender;
        var bl = new DS_Property_Br();

        bl.Sort(int.Parse(lb.Attributes["pid"]), bool.Parse(lb.Attributes["cn"]));
        AspNetPager_PageChanged(null, null);
    }
예제 #3
0
 private void Button1_Click(object sender, EventArgs e)
 {
     try {
         string pname = cname.Value.Trim();
         if (string.IsNullOrEmpty(pname))
         {
             Common.MessageBox.Show(this, "属性名称不能为空", Common.MessageBox.InfoType.warning);
             return;
         }
         if (DropDownList2.Items.Count.Equals(0))
         {
             Common.MessageBox.Show(this, "映射序号已用完,不能继续添加", Common.MessageBox.InfoType.warning);
             return;
         }
         var bl = new DS_Property_Br();
         var md = bl.CreateModel();
         md.ProName     = pname;
         md.SysCatID    = int.Parse(Request.QueryString["SysCatID"]);
         md.ControlType = byte.Parse(DropDownList1.SelectedIndex.ToString());
         md.Unit        = unit.Value.Trim();
         md.MapID       = byte.Parse(DropDownList2.SelectedValue);
         md.Request     = CheckBox1.Checked;
         md.Px          = 0;
         bl.Add(md);
         bl.Sort(md.ID, true);
         Common.MessageBox.Show(this, "保存成功", Common.MessageBox.InfoType.info, "function(){location='list.aspx?SysCatID=" + md.SysCatID + "'}");
     }catch (Exception ex) {
         Common.WriteLog.SetErrLog(Request.Url.ToString(), "Button1_Click", ex.Message);
         if (ex.Message.Contains("IX_DS_Property"))
         {
             Common.MessageBox.Show(this, "已存在相同的分类名称", Common.MessageBox.InfoType.error);
             return;
         }
         Common.MessageBox.Show(this, "保存发生意外,请联系管理人员解决。" + ex.Message, Common.MessageBox.InfoType.error);
     }
 }
예제 #4
0
파일: list.aspx.cs 프로젝트: uwitec/ds568
 protected void LinkButtonPx_Click(object sender, EventArgs e)
 {
     var lb = (LinkButton)sender;
     var bl = new DS_Property_Br();
     bl.Sort(int.Parse(lb.Attributes["pid"]), bool.Parse(lb.Attributes["cn"]));
     AspNetPager_PageChanged(null, null);
 }