Пример #1
0
 protected void SetButtonShowDialog(string pageUrl, int width, int height, IcoButton button, string sTitle)
 {
     button.OnClientClick = "javascript:CP.Popup.show(\"" + sTitle + "\",\"" + pageUrl + "\",\"\"," + width + "," + height + ");return false";
 }
Пример #2
0
 /// <summary>
 /// Kevin Xiao 2016/01/07
 /// Save Or Apply Logic
 /// </summary>
 protected void CanSave(bool IsAdministrator , IcoButton btnSave, IcoButton btnApply, NormalRaidDomain normalRaidDomain)
 {
     //Add by Andy.gui on 2011/12/21
     //1. 管理员没有限制
     if (IsAdministrator)
     {
         btnSave.Visible = true;
         btnApply.Visible = false;
         return;
     }
     bool isCreateAgent = normalRaidDomain.masterEntity.AgencyId == CurrentUser.SecUserEntity.AgencyId;
     //1. 不是同Agency
     if (!isCreateAgent)
     {
         btnSave.Visible = false;
         btnApply.Visible = false;
         //其他控件禁用,只能查看
         DisableControls();
         return;
     }
     DateTime now = DateTime.Now;
     // 2.1 正常录入
     if (normalRaidDomain.masterEntity.ActionDate >= normalRaidDomain.masterEntity.CreateDate)
     {
         // 如果是当前月份,则同Agency可以任意删除和修改
         if (normalRaidDomain.masterEntity.ActionDate.ToString("yyyyMM") == now.ToString("yyyyMM"))
         {
             //允许删除和修改操作
             btnSave.Visible = true;
             btnApply.Visible = false;
             return;
         }
     }
     else// 2.2 补录
     {
         // 创建日期+7天 大于 当前时间
         if(normalRaidDomain.masterEntity.CreateDate.AddDays(7) > now)
         {
             //允许删除和修改操作
             btnSave.Visible = true;
             btnApply.Visible = false;
             return;
         }
     }
     
     //3.申请 修改/删除 中的Action 不能删除和修改  //申请同意或拒绝后,必须将EditRecordID清空
     if (normalRaidDomain.masterEntity.Editrecordid != null && normalRaidDomain.masterEntity.Editrecordid.Trim() != "")
     {
         btnSave.Visible = false;
         btnApply.Visible = false;
         //其他控件禁用,只能查看
         DisableControls();
         return;
     }
     //4.申请同意的Action 可以 删除和修改
     if (MainService.RequestEditRecordService.IsApproved(normalRaidDomain.masterEntity.No.Trim(), CurrentUser.SecUserEntity.AgencyId, "Raid") == "1")
     {
         btnSave.Visible = true;
         btnApply.Visible = false;
     }
     else
     {
         btnSave.Visible = false;
         btnApply.Visible = true;
         //其他控件禁用,只能查看
         DisableControls();
     }
 }