示例#1
0
        public ActionResult Leave(string Telephone, string Name, int Age, string diy1, string diy2, string diy3)
        {
            ResultInfo ri    = new ResultInfo();
            LeaveWord  model = new LeaveWord()
            {
                Telephone  = Telephone,
                Age        = Age,
                Name       = Name,
                DIY1       = diy1,
                DIY2       = diy2,
                DIY3       = diy3,
                IsDelete   = 0,
                CreateTime = DateTime.Now,
            };

            DB.LeaveWord.Add(model);
            DB.SaveChanges();
            ri.Ok = true;
            //ri.Ok = LeaveWordBLL.Instance.Add(model) > 0;

            #region 留言成功 后 通知 百晓生

            _noticeService.OnLeaveWord_Notice_Master(10006, model);

            #endregion

            return(Result(ri));
        }
示例#2
0
    private void Bind()
    {
        LeaveWord leaveWord = LeaveWordManager.GetLeaveWordById(typeId);

        //this.txtStartTime.Value =Convert.ToString(leaveWord.MsgSendTime);
        this.txtSenderUser.Text = Convert.ToString(leaveWord.SenderUser.Name);
    }
示例#3
0
        /// <summary>
        /// 添加一条数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Add(LeaveWord model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into LeaveWord(");
            strSql.Append(" Telephone,Name,Age,DIY1,DIY2,DIY3,CreateTime,IsDelete )");
            strSql.Append(" values (");
            strSql.Append("@Telephone,@Name,@Age,@DIY1,@DIY2,@DIY3,@CreateTime,@IsDelete)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Telephone",  model.Telephone),
                new SqlParameter("@Name",       model.Name),
                new SqlParameter("@Age",        model.Age),
                new SqlParameter("@DIY1",       model.DIY1),
                new SqlParameter("@DIY2",       model.DIY2),
                new SqlParameter("@DIY3",       model.DIY3),
                new SqlParameter("@CreateTime", model.CreateTime),
                new SqlParameter("@IsDelete",   model.IsDelete),
            };

            object obj = SqlHelper.GetSingle(strSql.ToString(), CommandType.Text, parameters);

            return(obj == null ? 0 : Convert.ToInt32(obj));
        }
示例#4
0
    protected void btnReplay_Click(object sender, EventArgs e)
    {
        LeaveWord leaveWord = new LeaveWord();

        if (typeId > 0)
        {
            leaveWord.MsgTitle         = this.txtTitle.Text.Trim();
            leaveWord.MsgSendTime      = Convert.ToDateTime(this.txtStartTime.Value);
            leaveWord.MeetingBeginTime = Convert.ToDateTime("2010-10-01");
            leaveWord.MsgContent       = "";
            leaveWord.MsgState         = "";
            leaveWord.MeetingAddr      = "";
            leaveWord.ChargeMan        = "";
            leaveWord.MeetingType      = "";
            leaveWord.MsgTypeId.Id     = 4;
            leaveWord.SenderUser.UID   = 2;//Convert.ToString(this.txtSenderUser.Text.Trim());
            leaveWord.ReceiverUser.UID = 1;
            leaveWord.IsAgree          = "";
            leaveWord.Remark           = "";
            LeaveWordManager.AddLeaveWord(leaveWord);
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('回复成功!');</script>");

            Response.Redirect("ShowMessage.aspx");
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('回复失败!');</script>");
        }
    }
示例#5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!string.IsNullOrEmpty(Request.QueryString["TypeId"].ToString()))
         {
             typeId = Convert.ToInt32(Request.QueryString["TypeId"].ToString());
             if (Request.QueryString["typeTitle"] == null)
             {
                 LeaveWord leaveWord = LeaveWordManager.GetLeaveWordById(typeId);
                 this.txtTitle.Text      = leaveWord.MsgTitle;
                 this.txtSenderUser.Text = leaveWord.ReceiverUser.Name;
                 this.txtEndTime.Text    = Convert.ToString(leaveWord.MsgSendTime);
                 if (leaveWord.IsAgree.Trim() == "是")
                 {
                     this.rdoAgree.SelectedValue = "是";
                 }
                 else
                 {
                     this.rdoAgree.SelectedValue = "否";
                 }
                 this.txtRemark.Text = leaveWord.Remark;
                 this.btnOK.Visible  = false;
             }
             else
             {
                 typeId = Convert.ToInt32(Request.QueryString["TypeId"]);
                 Bind();
             }
         }
     }
 }
示例#6
0
    private void Bind()
    {
        LeaveWord leaveWord = LeaveWordManager.GetLeaveWordById(typeId);

        this.txtTitle.Text      = leaveWord.MsgTitle;
        this.txtEndTime.Text    = Convert.ToString(leaveWord.MeetingBeginTime);
        this.txtSenderUser.Text = Convert.ToString(leaveWord.ReceiverUser.Name);
    }
        public List <LiveSupport.LiveSupportModel.LeaveWord> GetLeaveWord()
        {
            LeaveWord lw = new LeaveWord();

            lw.Content = "111";
            leavewords.Add(lw);
            return(leavewords);
        }
示例#8
0
    private void Bind()
    {
        LeaveWord leaveWord = LeaveWordManager.GetLeaveWordMsgTypeId(typeId);

        this.txtTitle.Text      = leaveWord.MsgTitle;
        this.txtStartTime.Value = Convert.ToString(leaveWord.MsgSendTime);
        this.txtSenderUser.Text = Convert.ToString(leaveWord.SenderUser.Name);
        this.txDes.Value        = leaveWord.Remark;
    }
示例#9
0
    private void Bind()
    {
        LeaveWord leaveWord = LeaveWordManager.GetLeaveWordMsgTypeId(typeId);

        this.txtTitle.Text      = leaveWord.MsgTitle;
        this.txtSenderUser.Text = Convert.ToString(leaveWord.SenderUser.Name);
        this.txtEndTime.Text    = Convert.ToString(leaveWord.MsgSendTime);
        this.txtMsgContent.Text = leaveWord.MsgContent;
    }
示例#10
0
        /// <summary>
        /// 修改 (可能有其他业务逻辑检查)
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ResultInfo Update(LeaveWord model)
        {
            ResultInfo ri = new ResultInfo();

            if (Edit(model))
            {
                ri.Ok  = true;
                ri.Msg = "修改成功";
            }

            return(ri);
        }
示例#11
0
    private void Bind()
    {
        LeaveWord leaveWord = LeaveWordManager.GetLeaveWordById(typeId);

        this.txtTitle.Text                 = leaveWord.MsgTitle;
        this.txtStartTime.Text             = Convert.ToString(leaveWord.MeetingBeginTime);
        this.txtMeetingAddr.Text           = leaveWord.MeetingAddr;
        this.txtReceiverUser.Text          = Convert.ToString(leaveWord.ReceiverUser.Name);
        this.txtChargeMan.Text             = leaveWord.ChargeMan;
        this.dropMeetingType.SelectedValue = leaveWord.MeetingType;
        this.txtRemark.Text                = leaveWord.Remark;
    }
示例#12
0
    public void DataBindLeaveWord(string id)
    {
        LeaveWord lw = LeaveWordManager.GetLeaveWordById(id);

        this.lblCallerName.Text = lw.CallerName;
        this.lblEmail.Text      = lw.Email;
        this.lblIP.Text         = lw.Ip;
        this.lblPhone.Text      = lw.Phone;
        this.lblCallerName.Text = lw.CallerName;
        this.lblCallerDate.Text = lw.CallerDate;
        this.lblContent.Text    = lw.Content;
        this.lblSenddate.Text   = lw.Senddate;
        this.lblSubject.Text    = lw.Subject;
        this.lblIsSend.Text     = lw.IsSend;
        this.lblSendName.Text   = lw.OperatorName;
        this.lwId.Value         = lw.Id;
        this.lblDomainName.Text = lw.DomainName;
    }
示例#13
0
        public IList <LeaveWord> SelectLeaveWordByAll(string msgTypeId, string msgState, string meetingBeginTime)
        {
            IMessageType messageType = new MessageTypeService();
            int          msgType;
            int          sender;
            int          receiver;
            string       sql = "usp_GetAllLeaveWordMessage";

            SqlParameter[] para = new SqlParameter[]
            {
                new SqlParameter("@MsgType", msgTypeId == null?"":msgTypeId),
                new SqlParameter("@MsgState", msgState == null?"":msgState),
                new SqlParameter("@day", meetingBeginTime == null?"":meetingBeginTime)
            };
            IList <LeaveWord> list      = new List <LeaveWord>();
            LeaveWord         leaveword = null;

            using (DataTable table = DBHelper.GetDataTableProc(sql, para))
            {
                foreach (DataRow row in table.Rows)
                {
                    leaveword                  = new LeaveWord();
                    leaveword.Id               = (int)row["ID"];
                    leaveword.MsgTitle         = (string)row["MsgTitle"];
                    leaveword.MsgContent       = (string)row["MsgContent"];
                    leaveword.MsgSendTime      = (DateTime)row["MsgSendTime"];
                    leaveword.MsgState         = (string)row["MsgState"];
                    leaveword.MeetingAddr      = (string)row["MeetingAddr"];
                    leaveword.ChargeMan        = (string)row["ChargeMan"];
                    leaveword.MeetingBeginTime = (DateTime)row["MeetingBeginTime"];
                    leaveword.MeetingType      = (string)row["MeetingType"];
                    leaveword.IsAgree          = (string)row["IsAgree"];
                    leaveword.Remark           = (string)row["Remark"];
                    msgType             = (int)row["MsgTypeId"];
                    leaveword.MsgTypeId = messageType.GetMessageTypeById(msgType);
                    sender = (int)row["SenderUser"];
                    leaveword.SenderUser   = userInfo.GetAllUserById(sender);
                    receiver               = (int)row["ReceiverUser"];
                    leaveword.ReceiverUser = userInfo.GetAllUserById(receiver);
                    list.Add(leaveword);
                }
                return(list);
            }
        }
示例#14
0
        /// <summary>
        /// 保存 (可能有其他业务逻辑检查)
        /// </summary>
        /// <param name="model">实体</param>
        /// <returns></returns>
        public ResultInfo Create(LeaveWord model)
        {
            ResultInfo ri = new ResultInfo();

            if (model == null)
            {
                return(ri);
            }

            int result = Add(model);

            if (result > 0)
            {
                ri.Ok  = true;
                ri.Msg = "添加成功";
            }

            return(ri);
        }
示例#15
0
 public List <LiveSupport.LiveSupportModel.LeaveWord> GetAllLeaveWordByAccountId(string accountId)
 {
     try
     {
         string           sql  = string.Format("select * from LiveSupport_LeaveWord where accountId='{0}' order by isReplied", accountId);
         SqlDataReader    sdr  = DBHelper.GetReader(sql);
         List <LeaveWord> list = new List <LeaveWord>();
         while (sdr.Read())
         {
             LeaveWord lw = new LeaveWord(sdr);
             // lw.Account = new SqlAccountProvider().GetAccountByAccountId(sdr["accountId"].ToString());
             list.Add(lw);
         }
         sdr.Close();
         return(list);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
示例#16
0
 public List <LiveSupport.LiveSupportModel.LeaveWord> GetLeaveWordByAccountId(string accountId, string beginDate, string endDate)
 {
     try
     {
         string sql = string.Format("select * from LiveSupport_LeaveWord where accountId='{0}' and CallerDate>='{1}' and CallerDate<='{2}' order by Senddate", accountId, beginDate, endDate);
         using (SqlDataReader sdr = DBHelper.GetReader(sql))
         {
             List <LeaveWord> list = new List <LeaveWord>();
             while (sdr.Read())
             {
                 LeaveWord lw = new LeaveWord(sdr);
                 lw.Account = new SqlAccountProvider().GetAccountByAccountId(sdr["accountId"].ToString());
                 list.Add(lw);
             }
             return(list);
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
示例#17
0
    /// <summary>
    /// 离线时发送邮件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSendEmail_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(this.txt_username.Text) || string.IsNullOrEmpty(txtSendBy.Text))
        {
            return;
        }
        LeaveWord lw = new LeaveWord();

        lw.CallerName = this.txt_username.Text;
        lw.Content    = txtComment.Text;
        lw.Email      = txtSendBy.Text;
        lw.CallerDate = DateTime.Now.ToString();
        lw.Account    = AccountService.GetAccountById(CurrentVisitor.AccountId);
        lw.Id         = Guid.NewGuid().ToString();
        lw.Ip         = CurrentVisitor.CurrentSession.IP;
        lw.Phone      = txtPhone.Text;
        lw.Subject    = txtTheme.Text;
        lw.IsReplied  = false;
        lw.DomainName = CurrentVisitor.CurrentSession.DomainRequested;
        LiveSupport.BLL.LeaveWordManager.AddWordProvider(lw);
        ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>emailclose();</script>");
    }
示例#18
0
        public int AddLeaveWord(LeaveWord leave)
        {
            string sql = "usp_InsertLeaveWordMessage";

            SqlParameter[] para = new SqlParameter[]
            {
                new SqlParameter("@MsgTitle", leave.MsgTitle),
                new SqlParameter("@MsgContent", leave.MsgContent),
                new SqlParameter("@MsgTypeId", leave.MsgTypeId.Id),
                new SqlParameter("@SenderUser", leave.SenderUser.UID),
                new SqlParameter("@ReceiverUser", leave.ReceiverUser.UID),
                new SqlParameter("@MsgSendTime", leave.MsgSendTime),
                new SqlParameter("@MsgState", (leave.MsgState) == null?"":leave.MsgState),
                new SqlParameter("@MeetingAddr", (leave.MeetingAddr) == null?"":leave.MeetingAddr),
                new SqlParameter("@ChargeMan", (leave.ChargeMan) == null?"":leave.ChargeMan),
                new SqlParameter("@MeetingBeginTime", leave.MeetingBeginTime),
                new SqlParameter("@MeetingType", (leave.MeetingType) == null?"":leave.MeetingType),
                new SqlParameter("@IsAgree", (leave.IsAgree) == null?"":leave.IsAgree),
                new SqlParameter("@Remark", (leave.Remark) == null?"":leave.Remark)
            };
            return(DBHelper.ExecuteNonQueryProc(sql, para));
        }
示例#19
0
 public object SaveTable([FromBody] LeaveWord leaveWord)
 {
     try
     {
         EFHelper <LeaveWord> eFHelper = new EFHelper <LeaveWord>();
         eFHelper.Add(leaveWord);
         return(new NewErrorModel()
         {
             error = new Error(0, "保存成功!", "")
             {
             },
         });
     }
     catch (Exception ex)
     {
         return(new NewErrorModel()
         {
             error = new Error(1, ex.Message, "")
             {
             },
         });
     }
 }
示例#20
0
        void ws_GetLeaveWordCompleted(object sender, LiveSupport.OperatorConsole.LiveChatWS.GetLeaveWordCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                Trace.TraceError("ws_GetLeaveWordCompleted Error: " + e.Error.Message);
                //TODO: 通知窗体
                return;
            }

            leaveWords.Clear();
            foreach (var item in e.Result)
            {
                LeaveWord lw = Common.Convert(item) as LeaveWord;
                if (string.IsNullOrEmpty(lw.DomainName))
                {
                    List <LeaveWord> lws = new List <LeaveWord>();
                    lws.Add(lw);
                    leaveWords[""] = lws;
                }
                else if (leaveWords.ContainsKey(lw.DomainName))
                {
                    leaveWords[lw.DomainName].Add(lw);
                }
                else
                {
                    List <LeaveWord> lws = new List <LeaveWord>();
                    lws.Add(lw);
                    leaveWords[lw.DomainName] = lws;
                }
            }

            if (DataLoadCompleted != null)
            {
                DataLoadCompleted(this, new DataLoadCompletedEventArgs(DataLoadEventType.LeaveWord));
            }
        }
示例#21
0
 public LiveSupport.LiveSupportModel.LeaveWord GetLeaveWordById(string id)
 {
     try
     {
         string sql = "select * from LiveSupport_LeaveWord where Id='" + id + "'";
         using (SqlDataReader sdr = DBHelper.GetReader(sql))
         {
             if (sdr.Read())
             {
                 LeaveWord lw = new LeaveWord(sdr);
                 lw.Account = new SqlAccountProvider().GetAccountByAccountId(sdr["accountId"].ToString());
                 return(lw);
             }
             else
             {
                 return(null);
             }
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
示例#22
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Update(LeaveWord model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update LeaveWord set ");
            strSql.Append("Telephone=@Telephone,Name=@Name,Age=@Age,DIY1=@DIY1,DIY2=@DIY2,DIY3=@DIY3,CreateTime=@CreateTime,IsDelete=@IsDelete");

            strSql.Append(" where LeaveWordId=@LeaveWordId");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Telephone",   model.Telephone),
                new SqlParameter("@Name",        model.Name),
                new SqlParameter("@Age",         model.Age),
                new SqlParameter("@DIY1",        model.DIY1),
                new SqlParameter("@DIY2",        model.DIY2),
                new SqlParameter("@DIY3",        model.DIY3),
                new SqlParameter("@CreateTime",  model.CreateTime),
                new SqlParameter("@IsDelete",    model.IsDelete),

                new SqlParameter("@LeaveWordId", model.LeaveWordId)
            };

            return(SqlHelper.ExecuteSql(strSql.ToString(), CommandType.Text, parameters) > 0);
        }
示例#23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!string.IsNullOrEmpty(Request.QueryString["TypeId"].ToString()))
         {
             typeId = Convert.ToInt32(Request.QueryString["TypeId"].ToString());
             if (Request.QueryString["typeTitle"] == null)
             {
                 LeaveWord leaveWord = LeaveWordManager.GetLeaveWordById(typeId);
                 this.txtTitle.Text      = leaveWord.MsgTitle;
                 this.txtStartTime.Value = Convert.ToString(leaveWord.MsgSendTime);
                 this.txtSenderUser.Text = Convert.ToString(leaveWord.SenderUser.Name);
                 this.txDes.Value        = leaveWord.Remark;
                 this.btnReplay.Visible  = false;
             }
             else
             {
                 typeId = Convert.ToInt32(Request.QueryString["TypeId"]);
                 Bind();
             }
         }
     }
 }
示例#24
0
        public LeaveWord GetLeaveWordMsgTypeId(int msgTypeId)
        {
            IUserInfoService userInfo    = new UserInfoService();
            IMessageType     messageType = new MessageTypeService();
            int       msgType;
            int       sender;
            int       receiver;
            string    sql       = "usp_SelectLeaveWordMsgTypeId";
            LeaveWord leaveword = null;

            using (SqlDataReader row = DBHelper.ExecuteReaderProc(sql, new SqlParameter("@MsgTypeId", msgTypeId)))
            {
                while (row.Read())
                {
                    leaveword                  = new LeaveWord();
                    leaveword.Id               = (int)row["ID"];
                    leaveword.MsgTitle         = (string)row["MsgTitle"];
                    leaveword.MsgContent       = (string)row["MsgContent"];
                    leaveword.MsgSendTime      = (DateTime)row["MsgSendTime"];
                    leaveword.MsgState         = (string)row["MsgState"];
                    leaveword.MeetingAddr      = (string)row["MeetingAddr"];
                    leaveword.ChargeMan        = (string)row["ChargeMan"];
                    leaveword.MeetingBeginTime = (DateTime)row["MeetingBeginTime"];
                    leaveword.MeetingType      = (string)row["MeetingType"];
                    leaveword.IsAgree          = (string)row["IsAgree"];
                    leaveword.Remark           = (string)row["Remark"];
                    msgType             = (int)row["MsgTypeId"];
                    leaveword.MsgTypeId = messageType.GetMessageTypeById(msgType);
                    sender = (int)row["SenderUser"];
                    leaveword.SenderUser   = userInfo.GetAllUserById(sender);
                    receiver               = (int)row["ReceiverUser"];
                    leaveword.ReceiverUser = userInfo.GetAllUserById(receiver);
                }
            }
            return(leaveword);
        }
示例#25
0
 public IList <LeaveWord> GetAllLeaveWord()
 {
     IMessageType      messageType = new MessageTypeService();
     int               msgType;
     int               sender;
     int               receiver;
     string            sql       = "usp_selectLeaveWord";
     IList <LeaveWord> list      = new List <LeaveWord>();
     LeaveWord         leaveword = null;
     DataTable         table     = DBHelper.GetDataTableProc(sql, null);
     {
         foreach (DataRow row in table.Rows)
         {
             leaveword                  = new LeaveWord();
             leaveword.Id               = (int)row["ID"];
             leaveword.MsgTitle         = (string)row["MsgTitle"];
             leaveword.MsgContent       = (string)row["MsgContent"];
             leaveword.MsgSendTime      = (DateTime)row["MsgSendTime"];
             leaveword.MsgState         = (string)row["MsgState"];
             leaveword.MeetingAddr      = (string)row["MeetingAddr"];
             leaveword.ChargeMan        = (string)row["ChargeMan"];
             leaveword.MeetingBeginTime = (DateTime)row["MeetingBeginTime"];
             leaveword.MeetingType      = (string)row["MeetingType"];
             leaveword.IsAgree          = (string)row["IsAgree"];
             leaveword.Remark           = (string)row["Remark"];
             msgType             = (int)row["MsgTypeId"];
             leaveword.MsgTypeId = messageType.GetMessageTypeById(msgType);
             sender = (int)row["SenderUser"];
             leaveword.SenderUser   = userInfo.GetAllUserById(sender);
             receiver               = (int)row["ReceiverUser"];
             leaveword.ReceiverUser = userInfo.GetAllUserById(receiver);
             list.Add(leaveword);
         }
         return(list);
     }
 }
示例#26
0
 public void OnLeaveWord_Notice_Master(long masterId, LeaveWord leaveWord)
 {
     NoticeBLL.Instance.OnLeaveWord_Notice_Master(masterId, leaveWord, NoticeTypeEnum.OnLeaveWord);
 }
示例#27
0
    /// <summary>
    /// 添加审批记录
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        Examine em = new Examine();

        em.RequisitionID   = Convert.ToInt32(txtApplicationId.Text);
        em.RequisitionType = txtType.Text;
        em.ExamineUID.UID  = Convert.ToInt32(((UserInfo)Session["user"]).UID);
        em.ExamineIdea     = this.txtCause.Text;
        em.EndTime         = Convert.ToDateTime(txtTime.Value);
        em.IsApproved      = rdoAccess.SelectedValue == "未过" ? "未过" : "通过";

        //不管是否通过,都在审批记录表中添加一条审批记录
        if (ExamineManager.AddExamine(em) > 0)
        {
            //判断审批是否通过,
            if (rdoAccess.SelectedValue == "通过")
            {
                if (txtType.Text == "会议申请")
                {
                    try
                    {
                        MeetingApplication ma = MeetingApplicationManager.GetMeetingApplicationById(Convert.ToInt32(txtApplicationId.Text));
                        //获取所有与会人员,
                        string applicationMan = ma.WithinEnlistMan;

                        LeaveWord lw = new LeaveWord();
                        lw.MsgTitle         = ma.MeetTitle;                                         //会议标题
                        lw.MsgContent       = ma.MeetContent;                                       //会议内容
                        lw.MsgSendTime      = Convert.ToDateTime(DateTime.Now.ToShortDateString()); //发送时间
                        lw.MsgState         = "未读";
                        lw.MsgTypeId.Id     = 1;                                                    //1代表会议申请
                        lw.SenderUser       = user;                                                 //发送者
                        lw.MeetingBeginTime = ma.BeginTime;                                         //开会时间
                        lw.MeetingAddr      = ma.RoomInfo.RomeAddr;                                 //会议地点
                        lw.ChargeMan        = ma.Compere;                                           //会议负责人
                        lw.MeetingType      = ma.MeetType;

                        //用“,”号分割与会人员
                        string[] array = applicationMan.Split(new char[] { ',' });
                        for (int i = 0; i < array.Length; i++)
                        {
                            int uid = UserInfoManager.GetLeaveIDByMName(array[i]);
                            lw.ReceiverUser.UID = uid;
                            int flag = LeaveWordManager.AddLeaveWord(lw);
                        }
                        //更新会议申请的状态
                        MeetingApplicationManager.ModifyMeetingState(Convert.ToInt32(txtApplicationId.Text), "已办");
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('已审核!');location.href='CheckNote.aspx'", true);
                    }
                    catch (Exception)
                    {
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('审核失败!');", true);
                        return;
                    }
                }
                else if (txtType.Text == "用车申请")
                {
                    try
                    {
                        //更新用车申请状态
                        int flag = CarByapplyManager.UpadteByapplySate(Convert.ToInt32(txtApplicationId.Text), "已办");
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('已审核!');location.href='CheckNote.aspx'", true);
                    }
                    catch (Exception)
                    {
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('审核失败!');", true);
                        return;
                    }
                }
            }
            else   //不通过,终结申请
            {
                if (txtType.Text == "会议申请")
                {
                    MeetingApplicationManager.ModifyMeetingState(Convert.ToInt32(txtApplicationId.Text), "终结");
                }
                else if (txtType.Text == "用车申请")
                {
                    //终结用车申请
                    int flag = CarByapplyManager.UpadteByapplySate(Convert.ToInt32(txtApplicationId.Text), "终结");
                }


                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('已终结!');window.location='Matter.aspx'</script>", true);
            }



            if (txtType.Text == "任务申请") //根据实际完成金额更新任务总体完成进度
            {
                try
                {
                    if (em.IsApproved == "通过")
                    {
                        TaskManager.UpdateTaskNowStatus(Convert.ToInt32(txtApplicationId.Text));//更新任务状态
                        //更新任务的完成比例
                        TaskManager.UpdateTaskFinshStatus(Convert.ToInt32(txtApplicationId.Text));

                        //更新申请单状态为通过
                        new RolePowerManager().UpdatePaddingStatus("已办", Convert.ToInt32(txtApplicationId.Text.Trim()));
                    }
                    else
                    {
                        //更新申请单状态为终结
                        new RolePowerManager().UpdatePaddingStatus("终结", Convert.ToInt32(txtApplicationId.Text.Trim()));
                    }
                }
                catch (Exception)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('更新任务状态失败!');", true);
                    return;
                }
            }
            if (txtType.Text == "资源采购")
            {
                StockApplication stock = StockApplicationManager.Get((int)em.RequisitionID);
                if (em.IsApproved == "通过")
                {
                    stock.IsExamine = "已办";
                    IList <ApplicationResourseInfo> items = ApplicationResourceManager.GetAllApplicationResource(2, stock.SAID);
                    foreach (ApplicationResourseInfo item in items)
                    {
                        item.Resource.Number += item.Number;
                        ResourceInfoManager.UpdateResourceInfo(item.Resource);
                    }
                }
                else
                {
                    stock.IsExamine = "终结";
                }
                StockApplicationManager.Update(stock);
            }
            else if (txtType.Text == "资源借用")
            {
                BorrowApplication borrow = BorrowApplicationManager.Get((int)em.RequisitionID);
                if (em.IsApproved == "通过")
                {
                    borrow.IsExamine = "已办";
                    IList <ApplicationResourseInfo> items = ApplicationResourceManager.GetAllApplicationResource(1, borrow.BAID);
                    foreach (ApplicationResourseInfo item in items)
                    {
                        item.Resource.Number -= item.Number;
                        ResourceInfoManager.UpdateResourceInfo(item.Resource);
                    }
                }
                else
                {
                    borrow.IsExamine = "终结";
                }
                BorrowApplicationManager.Update(borrow);
            }

            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('已审核!');location.href='CheckNote.aspx'", true);
            // Response.Redirect("");
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('审核失败!');", true);
        }
    }
示例#28
0
 /// <summary>
 /// 添加一条记录,没有任何逻辑
 /// </summary>
 /// <param name="model">实体对象</param>
 /// <returns></returns>
 public int Add(LeaveWord model)
 {
     return(dal.Add(model));
 }
示例#29
0
 /// <summary>
 /// 修改一条记录
 /// </summary>
 /// <param name="model">实体对象</param>
 /// <returns></returns>
 public bool Edit(LeaveWord model)
 {
     return(dal.Update(model));
 }
示例#30
0
 public static int AddLeaveWord(LeaveWord leave)
 {
     return(leaveWordService.AddLeaveWord(leave));
 }