コード例 #1
0
        protected void SaveToolsButton_ServerClick(object sender, System.EventArgs e)
        {
            try
            {
                EntityData entity  = new EntityData("TaskGuid");
                DataRow    dr      = entity.GetNewRecord();
                string     strCode = DAL.EntityDAO.SystemManageDAO.GetNewSysCode("TaskGuid");
                dr["TaskGuidCode"]    = strCode;
                dr["WBSCode"]         = this.strWBSCode;
                dr["TaskGuidContent"] = StringRule.FormartInput(this.arDetail.Value.Trim());
                User user = (User)Session["User"];
                dr["TaskGuidPerson"] = user.UserCode;
                dr["CreateDate"]     = DateTime.Now;
                entity.AddNewRecord(dr);
                WBSDAO.InsertTaskGuid(entity);
                //保存当前工作参与人的资源

                // 待加入分发范围记录
                string strUser = this.txtUsers.Value.Trim();
                if (strUser.Length > 0)
                {
                    this.AddUser(this.strWBSCode, strUser, "5", strCode);                 // UserType为5是工作指示分发范围
                }
                string strStation = this.txtStations.Value.Trim();
                if (strStation.Length > 0)
                {
                    this.AddStation(this.strWBSCode, strStation, "5", strCode);                 // UserType为5是工作指示分发范围
                }
                // 取得当前工作参与人
//				string strUsers = "";
//				string strUserNames = "";
//				string strStations = "";
//				string strStationNames = "";
//				BLL.ResourceRule.GetAccessRange(this.strWBSCode,"0701","070107",ref strUsers,ref strUserNames,ref strStations,ref strStationNames);

                // 取得责任人
                strUser += "," + this.GetMaster(strWBSCode) + "," + base.user.UserCode;

                // 设定指示人权限加入资源
                this.SaveRS(strCode, CutRepeat(strUser), CutRepeat(this.txtStations.Value), "070402");

                this.JSAction();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "保存工作指示失败");
            }
        }
コード例 #2
0
ファイル: RemindModify.aspx.cs プロジェクト: riyuexing/rms
        protected void SaveToolsButton_ServerClick(object sender, System.EventArgs e)
        {
            try
            {
                string Action        = Request.QueryString["Action"] + "";
                string strRemindType = "";
                switch (Action.ToUpper())
                {
                //新增提醒
                case "INSERT":
                    EntityData entityInsert = DAL.EntityDAO.RemindDAO.GetAllRemindStrategy();
                    DataRow    drInsert     = entityInsert.GetNewRecord();
                    drInsert["RemindStrategyCode"] = DAL.EntityDAO.SystemManageDAO.GetNewSysCode("RemindStrategyCode");
                    if (this.rblRemindType.SelectedValue == "1")
                    {
                        drInsert["RemindDay"] = int.Parse(this.txtRemindDay.Text.Trim());
                    }
                    else
                    {
                        drInsert["RemindDay"] = int.Parse("-" + this.txtRemindDay.Text.Trim());
                    }

                    if (this.rblActive.SelectedValue == "1")
                    {
                        drInsert["IsActive"] = 1;
                    }
                    else
                    {
                        drInsert["IsActive"] = 0;
                    }
                    strRemindType = this.lstRemindType.Value;
                    if (strRemindType == "0" || strRemindType == "3")
                    {
                        string strObject = "";
                        if (this.chkMaster.Checked)
                        {
                            strObject += "2";
                        }
                        if (this.chkMonitor.Checked)
                        {
                            strObject += "1";
                        }
                        if (this.chkExecuter.Checked)
                        {
                            strObject += "0";
                        }
                        drInsert["ObjectCode"] = strObject;
                    }
                    else
                    {
                        drInsert["ObjectCode"] = this.lstRemindObject.Value;
                    }

                    drInsert["Type"]        = strRemindType;
                    drInsert["ProjectCode"] = (string)Session["ProjectCode"];
                    drInsert["Remark"]      = this.taRemark.Value.Trim();
                    entityInsert.AddNewRecord(drInsert);
                    RemindDAO.InsertRemindStrategy(entityInsert);
                    entityInsert.Dispose();
                    break;

                //修改
                case "MODIFY":
                    string     RemindCode   = Request.QueryString["Code"] + "";
                    EntityData entityModify = DAL.EntityDAO.RemindDAO.GetRemindStrategyByCode(RemindCode);
                    DataRow    drModify     = entityModify.CurrentRow;
                    if (this.rblRemindType.SelectedValue == "1")
                    {
                        drModify["RemindDay"] = int.Parse(this.txtRemindDay.Text.Trim());
                    }
                    else
                    {
                        drModify["RemindDay"] = int.Parse("-" + this.txtRemindDay.Text.Trim());
                    }

                    if (this.rblActive.SelectedValue == "1")
                    {
                        drModify["IsActive"] = 1;
                    }
                    else
                    {
                        drModify["IsActive"] = 0;
                    }
                    strRemindType = this.lstRemindType.Value;
                    if (strRemindType == "0" || strRemindType == "3")
                    {
                        string strObject = "";
                        if (this.chkMaster.Checked)
                        {
                            strObject += "2";
                        }
                        if (this.chkMonitor.Checked)
                        {
                            strObject += "1";
                        }
                        if (this.chkExecuter.Checked)
                        {
                            strObject += "0";
                        }
                        drModify["ObjectCode"] = strObject;
                    }
                    else
                    {
                        drModify["ObjectCode"] = this.lstRemindObject.Value;
                    }

                    drModify["Type"]   = strRemindType;
                    drModify["Remark"] = StringRule.FormartInput(this.taRemark.Value.Trim());
                    RemindDAO.UpdateRemindStrategy(entityModify);
                    entityModify.Dispose();
                    break;
                }

                Response.Write(JavaScript.ScriptStart);
                Response.Write("window.opener.location.reload();");
                Response.Write("window.close();");
                Response.Write(JavaScript.ScriptEnd);
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "保存提醒信息失败!");
            }
        }