예제 #1
0
 public void setValue(Model.Cash_Apply _modelCash_Apply)
 {
     string[] GetDateTime = DateTime.Parse(_modelCash_Apply.GetDateTime.ToString()).ToString("yyyy-MM-dd HH:mm:ss").Split(' ');
     txtGetDateTime.Value = GetDateTime[0];
     try { RadioButtonList_shijian.Items.FindByValue(" " + GetDateTime[1]).Selected = true; }
     catch { }
     txtUseFor.Text    = _modelCash_Apply.UseFor;
     txtUseFor.Enabled = false;
     RadioButtonList_shijian.Enabled = false;
 }
예제 #2
0
        /// <summary>
        /// 显示详情
        /// </summary>
        /// <param name="ID"></param>
        protected void ShowInfor(string ID)
        {
            try
            {
                mCash_Apply = bCash_Apply.GetModel(int.Parse(ID));

                if (null != mCash_Apply.UseFor && !mCash_Apply.UseFor.ToString().Equals(""))
                {
                    LB_Notes.Text = mCash_Apply.UseFor.ToString();
                }
                else
                {
                    LB_Notes.Text = "无";
                }
            }
            catch
            { }
        }
예제 #3
0
        /// <summary>
        ///点击确定按钮触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button_sumbit_Click(object sender, EventArgs e)
        {
            try
            {
                string strLimitNums   = (this.ddlCardName.SelectedItem.Text.Split(',')[1]).Split(']')[0];//cash表纪录的金额
                double dLimitNums     = double.Parse(strLimitNums);
                string strApplyCount  = this.txtApplyCount.Text;
                double dApplyCount    = double.Parse(strApplyCount);
                string strGetDateTime = this.txtGetDateTime.Value;
                // DateTime dTimeInput = new DateTime(Int32.Parse(strGetDateTime.Split('-')[0]), Int32.Parse(strGetDateTime.Split('-')[1]), Int32.Parse(strGetDateTime.Split('-')[2]), Int32.Parse(this.ddlHour.SelectedValue), Int32.Parse(this.ddlMin.SelectedValue), 0);
                DateTime dTimeInput = Convert.ToDateTime(strGetDateTime + RadioButtonList_shijian.SelectedValue.ToString());

                //用途
                string UserFor = this.txtUseFor.Text.Trim();
                if (RBlist_YYLX.SelectedValue == "1")
                {
                    if (dApplyCount > dLimitNums)
                    {
                        tag.Text = "申请数额不能超过所选资金卡的余额!";
                        return;
                    }
                }
                //用途拼接字符串
                UserFor = "[" + RBlist_YYLX.SelectedItem.Text + "]" + UserFor;

                if (Convert.ToDateTime(Convert.ToDateTime(strGetDateTime).ToString("yyyy-MM-dd")) < Convert.ToDateTime(DateTime.Now.AddDays(2).ToString("yyyy-MM-dd")))
                {
                    tag.Text = "经费预约必须提前二天,请电话联系相关人员!";
                    return;
                }

                mCash_Apply                   = new Dianda.Model.Cash_Apply();
                mCash_Apply.ProjectID         = Int32.Parse(this.ddlProjectID.SelectedValue);
                mCash_Apply.CashCertificateID = this.ddlCardName.SelectedValue;
                mCash_Apply.ApplyCount        = decimal.Parse(strApplyCount);
                mCash_Apply.GetDateTime       = dTimeInput;
                mCash_Apply.UseFor            = UserFor;
                mCash_Apply.ApplierTel        = this.txtApplierTel.Text;
                mCash_Apply.ApplierID         = ((Model.USER_Users)Session["USER_Users"]).ID;
                mCash_Apply.DATETIME          = DateTime.Now;
                mCash_Apply.Statas            = 0;//(0-待审核、1表示审核通过、2表示审核不通过)
                mCash_Apply.DoUserID          = ((Model.USER_Users)Session["USER_Users"]).ID;

                bCash_Apply.Add(mCash_Apply);

                /*给业务申请者发信息*/
                Model.FaceShowMessage mFaceShowMessage = new Dianda.Model.FaceShowMessage();
                BLL.FaceShowMessage   bFaceShowMessage = new Dianda.BLL.FaceShowMessage();

                mFaceShowMessage.DATETIME  = DateTime.Now;
                mFaceShowMessage.FromTable = "经费预约";
                mFaceShowMessage.IsRead    = 0;
                mFaceShowMessage.NewsID    = null;
                mFaceShowMessage.NewsType  = "经费预约";
                mFaceShowMessage.ReadTime  = null;
                mFaceShowMessage.Receive   = "经费预约";
                mFaceShowMessage.URLS      = ((Model.USER_Users)Session["USER_Users"]).REALNAME + "(" + ((Model.USER_Users)Session["USER_Users"]).USERNAME.ToString() + ")经费预约<a href='/Admin/cashCardManage/manageCashApply.aspx' target='_self' title='经费预约:提交时间" + DateTime.Now + "'>点击处理</a>";
                bFaceShowMessage.Add(mFaceShowMessage);
                /*给业务申请者发信息*/

                // tag.Text = "操作成功!";
                string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入列表页面\"); location.href = \"manageCashApply.aspx?pageindex=" + Request["pageindex"] + "\";</script>";
                Response.Write(coutws);

                //添加操作日志
                Dianda.BLL.SYS_LogsExt bsyslog    = new Dianda.BLL.SYS_LogsExt();
                Model.USER_Users       user_model = (Model.USER_Users)Session["USER_Users"];
                bsyslog.addlogs(((Model.USER_Users)Session["USER_Users"]).REALNAME + "(" + ((Model.USER_Users)Session["USER_Users"]).USERNAME + ")", "添加经费预约", "预约" + dTimeInput + "时间取" + strApplyCount + ":成功");
                //添加操作日志
            }
            catch
            {
                tag.Text = "操作失败,请重试!";
            }
        }
        /// <summary>
        /// 点击重置按钮触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button_reset_onclick(object sender, EventArgs e)
        {
            //选择编辑的条数只能为一条
            int num  = 0;
            int rows = GridView1.Rows.Count;

            if (rows > 0)
            {
                for (int i = 0; i < rows; i++)
                {
                    CheckBox cb = (CheckBox)GridView1.Rows[i].Cells[0].FindControl("CheckBox_choose");
                    if (cb.Checked)
                    {
                        num = num + 1;
                    }
                }

                if (num == 0)
                {
                    tag.Text = "请选择要操作的纪录!";
                }
                else
                {
                    tag.Text = "";
                    string info = "";
                    for (int j = 0; j < rows; j++)
                    {
                        CheckBox cb1 = (CheckBox)GridView1.Rows[j].Cells[0].FindControl("CheckBox_choose");
                        // HiddenField hid = (HiddenField)GridView1.Rows[j].Cells[0].FindControl("Hid_ID");
                        string id = GridView1.DataKeys[j]["ID"].ToString();
                        string ApplierRealName = GridView1.DataKeys[j]["ApplierRealName"].ToString();
                        string GetDateTime     = GridView1.DataKeys[j]["GetDateTime"].ToString();
                        string ApplyCount      = GridView1.DataKeys[j]["ApplyCount"].ToString();

                        if (cb1.Checked)
                        {
                            mCash_Apply          = new Dianda.Model.Cash_Apply();
                            mCash_Apply          = bCash_Apply.GetModel(Int32.Parse(id));
                            mCash_Apply.Statas   = 2;
                            mCash_Apply.DoUserID = ((Model.USER_Users)Session["USER_Users"]).ID;
                            bCash_Apply.Update(mCash_Apply);
                            info    += ("(" + ApplierRealName + "申请额度" + ApplyCount + "在" + GetDateTime + ")");
                            tag.Text = "操作成功!";
                            // string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入列表页面\"); location.href = \"manage.aspx?pageindex=" + Request["pageindex"] + "\";</script>";

                            Model.Cash_Cards mCash_Cards = new Dianda.Model.Cash_Cards();
                            BLL.Cash_Cards   bCash_Cards = new Dianda.BLL.Cash_Cards();
                            mCash_Cards = bCash_Cards.GetModel(Int32.Parse(mCash_Apply.CashCertificateID.ToString()));

                            /*给业务申请者发信息*/
                            Model.FaceShowMessage mFaceShowMessage = new Dianda.Model.FaceShowMessage();
                            BLL.FaceShowMessage   bFaceShowMessage = new Dianda.BLL.FaceShowMessage();

                            mFaceShowMessage.DATETIME  = DateTime.Now;
                            mFaceShowMessage.FromTable = "申请情况";
                            mFaceShowMessage.IsRead    = 0;
                            mFaceShowMessage.NewsID    = null;
                            mFaceShowMessage.NewsType  = "申请情况";
                            mFaceShowMessage.ReadTime  = null;
                            mFaceShowMessage.Receive   = mCash_Apply.ApplierID;
                            mFaceShowMessage.URLS      = "<a href='/Admin/cashCardManage/manageCashApplyPerson.aspx' target='_self' title='经费预约:提交时间" + DateTime.Now + "'>" + mCash_Cards.CardName + "的经费预约 审核不通过 </a>  (" + ((Model.USER_Users)Session["USER_Users"]).REALNAME + ")";
                            bFaceShowMessage.Add(mFaceShowMessage);
                            /*给业务申请者发信息*/
                        }
                    }

                    // 添加操作日志
                    Dianda.BLL.SYS_LogsExt bsyslog    = new Dianda.BLL.SYS_LogsExt();
                    Model.USER_Users       user_model = (Model.USER_Users)Session["USER_Users"];
                    bsyslog.addlogs(user_model.REALNAME + "(" + user_model.USERNAME + ")", "审核经费预约", "审核预约" + info + "不通过:成功");

                    string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入列表页面\"); location.href = \"manageCashApply.aspx?pageindex=" + pageindexHidden.Value + "&date=" + DDList_RQ.SelectedValue + "&status=" + this.ddlStatas.SelectedValue + "\";</script>";
                    Response.Write(coutws);
                }
            }
        }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof(add), this.Page);
            if (!IsPostBack)
            {
                Button[] SonBtn = new Button[] { };
                if (Request["ApplyID"] != null)
                {
                    ApplyID         = Request["ApplyID"];
                    modelCash_Apply = bllCash_Apply.GetModel(int.Parse(ApplyID));
                }

                if (Request.Params["parentpage"] != null && !String.IsNullOrEmpty(Request["parentpage"]))
                {
                    parentpage = Request["parentpage"];
                }
                else
                {
                    parentpage = "";
                }
                ShowButtonVisibleFalse();       //按钮全部不可见,按条件显示
                if (_parentpage == "manageCashApplyPerson")
                {
                    /*设置模板页中的管理值*/
                    (Master.FindControl("Label_navigation") as Label).Text = "经费 > 经费预约 > 新建预约 ";
                    /*设置模板页中的管理值*/
                    ReturnPage = ManageCashApplyPersonPage;
                    SonBtn     = new Button[] { Button_sumbit };
                }
                else if (_parentpage == "cashCardManageManageCashApplyPage")
                {
                    string key = "";            //按key值显示按钮
                    if (Request["key"] != null)
                    {
                        SetKey = Request["key"];
                    }
                    /*设置模板页中的管理值*/
                    if (SetKey == "1")
                    {
                        (Master.FindControl("Label_navigation") as Label).Text = "管理 > 财务管理 > 预约审核 ";
                        if (modelCash_Apply.Statas == 0)
                        {
                            SonBtn = new Button[] { Btn_Through, Btn_Unthread };
                            Pan_AuditOpinion.Visible = true;
                        }
                    }
                    else if (SetKey == "2")
                    {
                        (Master.FindControl("Label_navigation") as Label).Text = "管理 > 财务管理 > 审核完成 ";
                        if (modelCash_Apply.Statas == 1)
                        {
                            SonBtn = new Button[] { Btn_Done }
                        }
                        ;
                    }
                    /*设置模板页中的管理值*/
                    ReturnPage = cashCardManageManageCashApplyPage;
                }
                else
                {
                    /*设置模板页中的管理值*/
                    (Master.FindControl("Label_navigation") as Label).Text = "管理 > 财务管理 ";
                    /*设置模板页中的管理值*/
                    ReturnPage = ManageCashApplyPage;
                    SonBtn     = new Button[] { Button_sumbit };

                    string ProjectID = "";
                    if (Session["Work_ProjectId"] != null)
                    {
                        ProjectID = Session["Work_ProjectId"].ToString();
                    }

                    FeeAppointment1.setProjectID = ProjectID;
                }

                //调用自定义控件事件
                if (Session["USER_Users"] == null)
                {
                    return;
                }

                FeeAppointment1.UserName = ((Model.USER_Users)Session["USER_Users"]).USERNAME;
                FeeAppointment1.UserID   = ((Model.USER_Users)Session["USER_Users"]).ID;
                FeeAppointment1.SetKey   = SetKey;
                if (modelCash_Apply.ID != 0)
                {
                    setValue(modelCash_Apply);
                    FeeAppointment1._modelCash_Apply = modelCash_Apply;
                }
                FeeAppointment1.Show();

                //获取项目下拉列表
                //GetddlProjectID();

                ShowButtonVisibleTrue(SonBtn);
            }
        }
예제 #6
0
        public void funSubmit(string _Statas, string _MType)
        {
            Model.USER_Users user_model = (Model.USER_Users)Session["USER_Users"];
            string           coutws     = "";
            bool             TnF        = false;

            if (!string.IsNullOrEmpty(ApplyID))
            {
                TnF             = true;
                modelCash_Apply = bllCash_Apply.GetModel(int.Parse(ApplyID));
            }

            if (modelCash_Apply != null)
            {
                if (TnF && (modelCash_Apply.Statas.ToString() == _Statas))
                {
                    bool B = true;
                    switch (_MType)
                    {
                    case _TypeThrough: modelCash_Apply.Statas = 1; break;

                    case _TypeUnthread: modelCash_Apply.Statas = 2; break;

                    case _TypeDone: modelCash_Apply.Statas = 3; break;
                    }

                    if (_MType == _TypeUnthread)
                    {
                        string str         = modelCash_Apply.TEMP1;
                        string GetDateTime = modelCash_Apply.GetDateTime.ToString();
                        B = bllextCash_Account_Subscription.OperationAccount(str, GetDateTime, "2");
                    }

                    if (B)
                    {
                        modelCash_Apply.DoUserID = user_model.ID;

                        bllCash_Apply.Update(modelCash_Apply);

                        SendMessage(_MType, modelCash_Apply);

                        coutws = "alert(\"操作成功!现在返回列表页面\"); ";
                    }
                    else
                    {
                        coutws = "alert(\"操作失败!现在返回列表页面\"); ";
                    }
                }
                else
                {
                    coutws = "alert(\"该申请已不能操作!现在返回列表页面\")";
                }
            }
            else
            {
                coutws = "alert(\"未找到纪录!现在返回列表页面\")";
            }
            coutws += "location.href = \"" + ReturnPage + "?" + ReturnCS() + "\";";

            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "updateScript", coutws, true);
        }
예제 #7
0
        /// <summary>
        /// 发送消息
        /// </summary>
        public void SendMessage(string SendType, Model.Cash_Apply modelCash_Apply)
        {
            /*给业务申请者发信息*/
            Model.FaceShowMessage mFaceShowMessage = new Dianda.Model.FaceShowMessage();
            BLL.FaceShowMessage   bFaceShowMessage = new Dianda.BLL.FaceShowMessage();
            Model.USER_Users      user_model       = (Model.USER_Users)Session["USER_Users"];

            string SendName = "", SendUrl = "", doType = "", results = "", Receive = "";
            string ApplyCount   = modelCash_Apply.ApplyCount.ToString();
            string dTimeInput   = modelCash_Apply.GetDateTime.ToString();
            string Attribute    = modelCash_Apply.Attribute == "0" ? "资金卡:" : "专项资金:";
            string NameStr      = Attribute + modelCash_Apply.TEMP2;
            string AuditOpinion = (!string.IsNullOrEmpty(modelCash_Apply.AuditOpinion)) ? "(" + modelCash_Apply.AuditOpinion + ")" : "";

            switch (SendType)
            {
            case _TypeAdd:       //经费预约
                doType   = "添加经费预约";
                results  = "预约" + dTimeInput + "时间取" + ApplyCount;
                SendName = "经费预约";
                SendUrl  = "<a href='/Admin/cashCardManage/manageCashApply.aspx' target='_self' title='经费预约:提交时间" + DateTime.Now + "'>经费预约  金额 " + ApplyCount + "</a>" + "  " + dTimeInput + " (" + user_model.REALNAME + ")";
                break;

            case _TypeThrough:       //预约审核通过
                doType   = "审核经费预约";
                results  = "审核预约(申请额度" + ApplyCount + "在" + dTimeInput + ")通过";
                SendName = "申请情况";
                Receive  = modelCash_Apply.ApplierID;
                SendUrl  = "<a href='/Admin/cashCardManage/manageCashApplyPerson.aspx?status=1' target='_self' title='经费预约:提交时间" + DateTime.Now + "'>" + NameStr + "的经费预约 审核通过 " + AuditOpinion + "</a>  (" + user_model.REALNAME + ")";
                break;

            case _TypeUnthread:       //预约审核不通过
                doType   = "审核经费预约";
                results  = "审核预约(申请额度" + ApplyCount + "在" + dTimeInput + ")不通过";
                SendName = "申请情况";
                Receive  = modelCash_Apply.ApplierID;
                SendUrl  = "<a href='/Admin/cashCardManage/manageCashApplyPerson.aspx?status=2' target='_self' title='经费预约:提交时间" + DateTime.Now + "'>" + NameStr + "的经费预约 审核不通过 " + AuditOpinion + "</a>  (" + user_model.REALNAME + ")";
                break;

            case _TypeDone:       //预约完成
                doType   = "审核经费完成";
                results  = "审核完成(" + "申请额度" + ApplyCount + "在" + dTimeInput + ")完成";
                SendName = "申请情况";
                SendUrl  = "<a href='/Admin/cashCardManage/manageCashApplyPerson.aspx?status=3' target='_self' title='经费预约:提交时间" + DateTime.Now + "'>" + NameStr + "的经费预约 审核完成 </a>  (" + user_model.REALNAME + ")";
                break;
            }

            mFaceShowMessage.DATETIME  = DateTime.Now;
            mFaceShowMessage.FromTable = SendName;
            mFaceShowMessage.IsRead    = 0;
            mFaceShowMessage.NewsID    = null;
            mFaceShowMessage.NewsType  = SendName;
            mFaceShowMessage.ReadTime  = null;
            mFaceShowMessage.Receive   = Receive;
            mFaceShowMessage.ProjectID = modelCash_Apply.ProjectID;
            mFaceShowMessage.DELFLAG   = 0;
            mFaceShowMessage.URLS      = SendUrl;
            bFaceShowMessage.Add(mFaceShowMessage);
            /*给业务申请者发信息*/

            //添加操作日志
            Dianda.BLL.SYS_LogsExt bsyslog = new Dianda.BLL.SYS_LogsExt();
            bsyslog.addlogs(user_model.REALNAME + "(" + user_model.USERNAME + ")", doType, results + ":成功");
            //添加操作日志
        }