Exemplo n.º 1
0
 protected void btnDel_Click(object sender, EventArgs e)
 {
     if (GetCheckBoxValue())
     {
         var p = PolicyManageService.QueryPolicyIds(GetCondition());
         if (hidIsAll.Value == "1")
         {
             int count = p.Count(item => item.Value == true);
             if (count != 0)
             {
                 ShowMessage("删除政策失败,其中存在 " + count + " 条 已审核。全部取消审核才能删除!");
                 return;
             }
         }
         var list_ids = hidIsAll.Value == "0" ? hidIds.Value.Split(',').Select(Guid.Parse) : p.Select(item => item.Key);
         try
         {
             PolicyManageService.DeleteTeamPolicy(this.CurrentUser.UserName, list_ids.ToArray());
             QueryTeamPolicy(pager.CurrentPageIndex);
             ClaerHidValue();
         }
         catch (Exception ex)
         {
             ShowExceptionMessage(ex, "删除政策");
         }
     }
 }
        protected void btnAudited_Click(object sender, EventArgs e)
        {
            if (GetCheckBoxValue())
            {
                var p = PolicyManageService.QueryPolicyIds(GetCondition());

                var list_ids = hidIsAll.Value == "0" ? hidIds.Value.Split(',').Select(Guid.Parse) : p.Select(item => item.Key);
                PolicyManageService.Audit(PolicyType.Bargain, this.CurrentUser.UserName, list_ids.ToArray());
                QueryBargainPolicy(pager.CurrentPageIndex); ClaerHidValue();
            }
        }
Exemplo n.º 3
0
 protected void btnUnAudited_Click(object sender, EventArgs e)
 {
     if (GetCheckBoxValue())
     {
         var list_ids = hidIsAll.Value == "0" ? hidIds.Value.Split(',').Select(Guid.Parse) : PolicyManageService.QueryPolicyIds(GetCondition()).Select(item => item.Key);
         try
         {
             PolicyManageService.CancelAudit(PolicyType.Team, this.CurrentUser.UserName, list_ids.ToArray());
         }
         catch (Exception ex)
         {
             ShowExceptionMessage(ex, "取消审核");
         }
         QueryTeamPolicy(pager.CurrentPageIndex);
         ClaerHidValue();
     }
 }
Exemplo n.º 4
0
 protected void btnSaveunlock_Click(object sender, EventArgs e)
 {
     if (CheckBoxValue())
     {
         var p = GetCondition();
         p.PolicyType = PolicyType.Notch;
         var listIds = hidIsAll.Value == "0" ? hidIds.Value.Split(',').Select(Guid.Parse) : PolicyManageService.QueryPolicyIds(p).Select(item => item.Key);
         hidIsAll.Value = "";
         hidIds.Value   = "";
         try
         {
             PolicyManageService.UnLockPolicy(PolicyType.Notch, this.CurrentUser.UserName, this.txtunlockReason.Text, CurrentCompany.CompanyType == CompanyType.Platform ? OperatorRole.Platform : OperatorRole.User, listIds.ToArray());
             QueryNotchPolicy(grv_normal.PageIndex + 1);
             ClaerHidValue();
         }
         catch (Exception ex)
         {
             QueryNotchPolicy(grv_normal.PageIndex + 1);
             ShowExceptionMessage(ex, "解锁政策");
             QueryNotchPolicy(grv_normal.PageIndex + 1);
             return;
         }
     }
 }
 protected void btnSavelock_Click(object sender, EventArgs e)
 {
     if (CheckBoxValue())
     {
         var p = GetCondition();
         p.PolicyType = PolicyType.Bargain;
         var listIds = hidIsAll.Value == "0" ? hidIds.Value.Split(',').Select(Guid.Parse) : PolicyManageService.QueryPolicyIds(p).Select(item => item.Key);
         hidIsAll.Value = "";
         hidIds.Value   = "";
         try
         {
             PolicyManageService.LockPolicy(PolicyType.Bargain, this.CurrentUser.UserName, this.txtlockReason.Text, CurrentCompany.CompanyType == CompanyType.Platform ? OperatorRole.Platform : OperatorRole.User, listIds.ToArray());
             QueryLowPricePolicy(grv_bargain.PageIndex + 1);
             ClaerHidValue();
         }
         catch (Exception ex)
         {
             ShowExceptionMessage(ex, "锁定政策");
             QueryLowPricePolicy(grv_bargain.PageIndex + 1);
             return;
         }
     }
     //if (CheckBoxValue())
     //{
     //    var list_ids = hidIds.Value.Split(',').Select(item => Guid.Parse(item));
     //    PolicyManageService.LockPolicy(PolicyType.Bargain, this.CurrentUser.UserName, this.txtlockReason.Text, CurrentCompany.CompanyType == CompanyType.Platform ? OperatorRole.Platform : OperatorRole.User, list_ids.ToArray());
     //    QueryLowPricePolicy(grv_bargain.PageIndex + 1);
     //}
 }