Exemplo n.º 1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            #region 逻辑检查
            if (nbxProcedureOrder.Text == "0")
            {
                Alert.ShowInTop("次序应当为大于0的整数", "错误", MessageBoxIcon.Error);
                return;
            }
            #endregion
            #region 保存
            Model.tb_JC_RoutingSub modelRoutingSub = new Model.tb_JC_RoutingSub();
            modelRoutingSub.ID             = Request.QueryString["ID"];
            modelRoutingSub.RoutingID      = hdfRoutingID.Text;
            modelRoutingSub.ProcedureNO    = tgbProcedureNO.Text;
            modelRoutingSub.ProcedureOrder = int.Parse(nbxProcedureOrder.Text);

            BLL.tb_JC_RoutingSub bllRoutingSub = new BLL.tb_JC_RoutingSub();
            bool result = bllRoutingSub.Update(modelRoutingSub);
            if (result)
            {
                Alert.ShowInTop("修改成功", "信息", MessageBoxIcon.Information, ActiveWindow.GetHidePostBackReference("Sub_Modify_Success"));
            }
            else
            {
                Alert.ShowInTop("修改失败", "错误", MessageBoxIcon.Error, ActiveWindow.GetHidePostBackReference("Sub_Modify_Fail"));
            }
            #endregion
        }
Exemplo n.º 2
0
 //删除选中记录集
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     FineUI.Button btn = (FineUI.Button)sender;
     #region 主表删除事件
     if (btn.ID == "btnDelete")
     {
         if (gridRoutingSub.RecordCount > 0)
         {
             Alert.ShowInTop("在删除该项前,请删除所有子项", "错误", MessageBoxIcon.Error);
             return;
         }
         else
         {
             BLL.tb_JC_Routing bllRouting = new BLL.tb_JC_Routing();
             string            id         = gridRouting.DataKeys[gridRouting.SelectedRowIndex][0].ToString();
             bool result = bllRouting.Delete(id);
             if (result)
             {
                 Alert.ShowInTop("删除成功", "信息", MessageBoxIcon.Information);
                 BindGrid();
             }
             else
             {
                 Alert.ShowInTop("删除失败", "错误", MessageBoxIcon.Error);
             }
             return;
         }
     }
     #endregion
     #region  除子表记录
     if (btn.ID == "btnDeleteSub")
     {
         BLL.tb_JC_RoutingSub bllRoutingSub = new BLL.tb_JC_RoutingSub();
         string id     = gridRoutingSub.DataKeys[gridRoutingSub.SelectedRowIndex][0].ToString();
         bool   result = bllRoutingSub.Delete(id);
         if (result)
         {
             Alert.ShowInTop("删除成功", "信息", MessageBoxIcon.Information);
             BindGridSub(gridRouting.DataKeys[gridRouting.SelectedRowIndex][0].ToString());
         }
         else
         {
             Alert.ShowInTop("删除失败", "错误", MessageBoxIcon.Error);
         }
         return;
     }
     #endregion
 }