Пример #1
0
    protected void OpenForm(int formID)
    {
        FormTableAdapter taForm = new FormTableAdapter();

        taForm.FillByID(this.InnerDS.Form, formID);
        FormDS.FormRow rowForm = this.InnerDS.Form[0];
        FormBudgetAllocationTableAdapter taFormBudgetAllocation = new FormBudgetAllocationTableAdapter();

        taFormBudgetAllocation.FillByID(this.InnerDS.FormBudgetAllocation, formID);
        FormDS.FormBudgetAllocationRow rowFormBudgetAllocation = this.InnerDS.FormBudgetAllocation[0];
        //赋值
        if (!rowFormBudgetAllocation.IsRemarkNull())
        {
            this.RemarkCtl.Text = rowFormBudgetAllocation.Remark;
        }
        if (!rowFormBudgetAllocation.IsAttachFileNameNull())
        {
            this.UCFileUpload.AttachmentFileName = rowFormBudgetAllocation.AttachFileName;
        }
        if (!rowFormBudgetAllocation.IsRealAttachFileNameNull())
        {
            this.UCFileUpload.RealAttachmentFileName = rowFormBudgetAllocation.RealAttachFileName;
        }

        // 打开明细表
        FormBudgetAllocationDetailTableAdapter taDetail = new FormBudgetAllocationDetailTableAdapter();

        taDetail.FillByFormID(this.InnerDS.FormBudgetAllocationDetail, formID);
    }
Пример #2
0
        //启动流程
        public void ApplyForm(APHelper AP, FormTableAdapter FormTA, int?RejectedFormID, FormDS.FormRow formRow, int OrganizationUnitID, string ProcessTemplateName, SystemEnums.FormStatus StatusID, Dictionary <string, object> map)
        {
            string email = string.Empty;

            if (StatusID == SystemEnums.FormStatus.Awaiting)
            {
                string ProcID = AP.createProcess(formRow.FormNo + ":" + DateTime.Now.ToString(), ProcessTemplateName, map);
                formRow.ProcID = ProcID;

                String inTurnStr = AP.startProcess(ProcID, OrganizationUnitID, ref email, formRow.UserID.ToString(), new AuthorizationBLL().GetStuffUserById(formRow.UserID).StuffName);

                string[] InTurn = inTurnStr.Split('&');//不同流程角色下的人员和职位
                string   ids    = "";
                string   pids   = "";
                for (int a = 0; a < InTurn.Length; a++)
                {
                    ids  += InTurn[a].Split('$')[0].ToString(); ///人员
                    pids += InTurn[a].Split('$')[1].ToString(); //职位
                }
                formRow.InTurnUserIds     = ids;                //下一步的人员
                formRow.InTurnPositionIds = pids;               //下一步的人员职位
                formRow.StatusID          = (int)SystemEnums.FormStatus.Awaiting;
                FormTA.Update(formRow);
            }

            //作废之前的单据
            if (RejectedFormID != null)
            {
                FormDS.FormRow oldRow = FormTA.GetDataByID(RejectedFormID.GetValueOrDefault())[0];
                if (oldRow.StatusID == (int)SystemEnums.FormStatus.Rejected)
                {
                    ScrapForm(oldRow.FormID);
                }
            }
        }
Пример #3
0
    protected void gvReimburseDetails_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        // 对数据列进行赋值
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            if ((e.Row.RowState & DataControlRowState.Edit) != DataControlRowState.Edit)
            {
                DataRowView drvDetail             = (DataRowView)e.Row.DataItem;
                FormDS.FormReimburseDetailRow row = (FormDS.FormReimburseDetailRow)drvDetail.Row;
                ApplyFeeTotal     = decimal.Round((ApplyFeeTotal + row.AccruedAmount), 2);
                RemainFeeTotal    = decimal.Round((RemainFeeTotal + row.RemainAmount), 2);
                ReimburseFeeTotal = decimal.Round((ReimburseFeeTotal + row.Amount), 2);

                TextBox txtAmount = (TextBox)e.Row.FindControl("txtAmount");
                txtAmount.Attributes.Add("onBlur", "PlusTotal(this);");
                txtAmount.Attributes.Add("onFocus", "MinusTotal(this)");

                HyperLink      lblApplyFormNo = (HyperLink)e.Row.FindControl("lblApplyFormNo");
                FormDS.FormRow form           = this.SalesReimburseBLL.GetFormByID(row.FormApplyID)[0];
                switch (form.PageType)
                {
                case (int)SystemEnums.PageType.PromotionApply:
                    lblApplyFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/SalesForm/SalesPromotionApproval.aspx?ShowDialog=1&ObjectId=" + row.FormApplyID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
                    break;

                case (int)SystemEnums.PageType.GeneralApply:
                    lblApplyFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/SalesForm/SalesGeneralApproval.aspx?ShowDialog=1&ObjectId=" + row.FormApplyID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
                    break;

                case (int)SystemEnums.PageType.RebateApply:
                    lblApplyFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/SalesForm/SalesRebateApproval.aspx?ShowDialog=1&ObjectId=" + row.FormApplyID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
                    break;

                case (int)SystemEnums.PageType.GeneralApplyExecute:
                    lblApplyFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/SalesForm/SalesGeneralExecution.aspx?ShowDialog=1&ObjectId=" + row.FormApplyID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
                    break;

                case (int)SystemEnums.PageType.PromotionApplyExecute:
                    lblApplyFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/SalesForm/SalesPromotionExecution.aspx?ShowDialog=1&ObjectId=" + row.FormApplyID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
                    break;
                }
            }
        }

        if (e.Row.RowType == DataControlRowType.Footer)
        {
            Label applbl = (Label)e.Row.FindControl("applbl");
            applbl.Text = ApplyFeeTotal.ToString("N");

            Label Remainlbl = (Label)e.Row.FindControl("Remainlbl");
            Remainlbl.Text = RemainFeeTotal.ToString("N");

            Label totallbl = (Label)e.Row.FindControl("totallbl");
            totallbl.Text = ReimburseFeeTotal.ToString("N");
        }
    }
Пример #4
0
    protected void OpenForm(int formID)
    {
        FormTableAdapter taForm = new FormTableAdapter();

        FormDS.FormRow           rowForm        = taForm.GetDataByID(formID)[0];
        FormContractTableAdapter taFormContract = new FormContractTableAdapter();

        FormDS.FormContractRow rowFormContract = taFormContract.GetDataById(formID)[0];
        //赋值
        TextBox txtBeginDate = (TextBox)(this.UCPeriodBegin.FindControl("txtDate"));
        TextBox txtEndDate   = (TextBox)(this.UCPeriodEnd.FindControl("txtDate"));

        this.txtFirstCompany.Text = rowFormContract.FirstCompany;
        if (!rowFormContract.IsSecondCompanyNull())
        {
            this.txtSecondCompany.Text = rowFormContract.SecondCompany;
        }
        if (!rowFormContract.IsThirdCompanyNull())
        {
            this.txtThirdCompany.Text = rowFormContract.ThirdCompany;
        }
        this.txtContractName.Text          = rowFormContract.ContractName;
        this.txtContractAmount.Text        = rowFormContract.ContractAmount.ToString();
        this.txtPageNumber.Text            = rowFormContract.PageNumber.ToString();
        this.dplContractType.SelectedValue = rowFormContract.ContractTypeID.ToString();
        if (!rowFormContract.IsPaymentTypeNull())
        {
            this.txtPaymentType.Text = rowFormContract.PaymentType;
        }
        if (!rowFormContract.IsBeginDateNull())
        {
            txtBeginDate.Text = rowFormContract.BeginDate.ToShortDateString();
        }
        if (!rowFormContract.IsEndDateNull())
        {
            txtEndDate.Text = rowFormContract.EndDate.ToShortDateString();
        }
        if (!rowFormContract.IsMainContentNull())
        {
            this.txtMainContent.Text = rowFormContract.MainContent;
        }
        if (!rowFormContract.IsChangePartNull())
        {
            this.txtChangePart.Text = rowFormContract.ChangePart;
        }
        if (!rowFormContract.IsAttachedFileNameNull())
        {
            this.UCFileUpload.AttachmentFileName = rowFormContract.AttachedFileName;
        }
        if (!rowFormContract.IsRealAttachedFileNameNull())
        {
            this.UCFileUpload.RealAttachmentFileName = rowFormContract.RealAttachedFileName;
        }
    }
Пример #5
0
    protected void OpenForm(int formID)
    {
        FormTableAdapter taForm = new FormTableAdapter();

        taForm.FillByID(this.InnerDS.Form, formID);
        FormDS.FormRow        rowForm     = this.InnerDS.Form[0];
        FormApplyTableAdapter taFormApply = new FormApplyTableAdapter();

        taFormApply.FillByID(this.InnerDS.FormApply, formID);
        FormDS.FormApplyRow rowFormApply = this.InnerDS.FormApply[0];
        //赋值
        this.ViewState["BeginPeriod"]          = rowFormApply.BeginPeriod.ToShortDateString();
        this.ViewState["EndPeriod"]            = rowFormApply.EndPeriod.ToShortDateString();
        this.BeginPeriodCtl.Text               = rowFormApply.BeginPeriod.ToString("yyyy-MM");
        this.EndPeriodCtl.Text                 = rowFormApply.EndPeriod.ToString("yyyy-MM");
        this.ViewState["ExpenseSubCategoryID"] = rowFormApply.ExpenseSubCategoryID.ToString();
        this.ExpenseSubCategoryCtl.Text        = new MasterDataBLL().GetExpenseSubCateNameById(rowFormApply.ExpenseSubCategoryID);
        this.ViewState["CustomerID"]           = rowFormApply.CustomerID.ToString();
        ERS.CustomerRow customer = new MasterDataBLL().GetCustomerById(rowFormApply.CustomerID);
        this.CustomerNameCtl.Text = customer.CustomerName;
        //this.CustomerTypeCtl.Text = new MasterDataBLL().GetCustomerTypeById(customer.CustomerTypeID).CustomerTypeName;
        this.odsShop.SelectParameters["CustomerID"].DefaultValue = customer.CustomerID.ToString();

        this.ShopDDL.SelectedValue        = rowFormApply.ShopID.ToString();
        this.PaymentTypeDDL.SelectedValue = rowFormApply.PaymentTypeID.ToString();
        if (!rowFormApply.IsContractNoNull())
        {
            this.ContractNoCtl.Text = rowFormApply.ContractNo;
        }
        if (!rowFormApply.IsRemarkNull())
        {
            this.RemarkCtl.Text = rowFormApply.Remark;
        }
        if (!rowFormApply.IsAttachedFileNameNull())
        {
            this.UCFileUpload.AttachmentFileName = rowFormApply.AttachedFileName;
        }
        if (!rowFormApply.IsRealAttachedFileNameNull())
        {
            this.UCFileUpload.RealAttachmentFileName = rowFormApply.RealAttachedFileName;
        }
        if (!rowFormApply.IsFormApplyNameNull())
        {
            this.txtFormApplyName.Text = rowFormApply.FormApplyName.ToString();
        }
    }
Пример #6
0
    protected void SubmitBtn_Click(object sender, EventArgs e)
    {
        try {
            if (this.cwfAppCheck.CheckInputData())
            {
                AuthorizationDS.StuffUserRow currentStuff = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
                string ProxyStuffName = null;
                if (Session["ProxyStuffUserId"] != null)
                {
                    ProxyStuffName = new StuffUserBLL().GetStuffUserById(int.Parse(Session["ProxyStuffUserId"].ToString()))[0].StuffName;
                }
                new APFlowBLL().ApproveForm(CommonUtility.GetAPHelper(Session), this.cwfAppCheck.FormID, currentStuff.StuffUserId, currentStuff.StuffName,
                                            this.cwfAppCheck.GetApproveOrReject(), this.cwfAppCheck.GetComments(), ProxyStuffName, int.Parse(ViewState["OrganizationUnitID"].ToString()));

                //如果是跨越的话,拆分申请单
                FormDS.FormApplyRow formApply = this.SalesApplyBLL.GetFormApplyByID(this.cwfAppCheck.FormID)[0];
                FormDS.FormRow      formRow   = this.SalesApplyBLL.GetFormByID(this.cwfAppCheck.FormID)[0];
                //审批完成后,就应该是执行确认的步骤,要更改pagetype
                if (formRow.StatusID == 2)
                {
                    formRow.PageType = (int)SystemEnums.PageType.PromotionApplyExecute;
                    new FormTableAdapter().Update(formRow);
                    if (formApply.EndPeriod > formApply.BeginPeriod)
                    {
                        new APFlowBLL().GenerateApplyForm(this.cwfAppCheck.FormID);
                    }
                }

                if (this.Request["Source"] != null)
                {
                    this.Response.Redirect(this.Request["Source"].ToString());
                }
                else
                {
                    this.Response.Redirect("~/Home.aspx");
                }
            }
        } catch (Exception exception) {
            this.cwfAppCheck.ReloadCtrl();
            PageUtility.DealWithException(this, exception);
        }
    }
Пример #7
0
    protected void OpenForm(int formID)
    {
        FormTableAdapter taForm = new FormTableAdapter();

        taForm.FillByID(this.InnerDS.Form, formID);
        FormDS.FormRow rowForm = this.InnerDS.Form[0];
        FormPersonalReimburseTableAdapter taFormTravelReimburse = new FormPersonalReimburseTableAdapter();

        taFormTravelReimburse.FillByID(this.InnerDS.FormPersonalReimburse, formID);
        FormDS.FormPersonalReimburseRow rowFormTravelReimburse = this.InnerDS.FormPersonalReimburse[0];
        this.ViewState["FormTravelApplyID"] = rowFormTravelReimburse.FormTravelApplyID;
        //赋值
        this.PeriodDDL.DataSourceID = "odsPeriod";
        this.PeriodDDL.DataBind();
        ListItem item = this.PeriodDDL.Items.FindByText(rowFormTravelReimburse.Period.ToString("yyyy-MM"));

        if (item != null)
        {
            this.PeriodDDL.SelectedValue = item.Value;
        }
        if (!rowFormTravelReimburse.IsRemarkNull())
        {
            this.RemarkCtl.Text = rowFormTravelReimburse.Remark;
        }
        if (!rowFormTravelReimburse.IsAttachedFileNameNull())
        {
            this.UCFileUpload.AttachmentFileName = rowFormTravelReimburse.AttachedFileName;
        }
        if (!rowFormTravelReimburse.IsRealAttachedFileNameNull())
        {
            this.UCFileUpload.RealAttachmentFileName = rowFormTravelReimburse.RealAttachedFileName;
        }

        OpenTravelApplyForm(rowFormTravelReimburse.FormTravelApplyID);
        // 打开明细表
        FormPersonalReimburseDetailTableAdapter taDetail = new FormPersonalReimburseDetailTableAdapter();

        taDetail.FillByFormID(this.InnerDS.FormPersonalReimburseDetail, formID);
    }
Пример #8
0
    protected void OpenForm(int formID)
    {
        FormTableAdapter taForm = new FormTableAdapter();

        taForm.FillByID(this.InnerDS.Form, formID);
        FormDS.FormRow           rowForm        = this.InnerDS.Form[0];
        FormMaterialTableAdapter taFormMaterial = new FormMaterialTableAdapter();

        taFormMaterial.FillByID(this.InnerDS.FormMaterial, formID);
        FormDS.FormMaterialRow rowFormMaterial = this.InnerDS.FormMaterial[0];
        //赋值
        this.UCShop.ShopID        = rowFormMaterial.ShopID.ToString();
        this.FirstVolumeCtl.Text  = rowFormMaterial.FirstVolume.ToString();
        this.SecondVolumeCtl.Text = rowFormMaterial.SecondVolume.ToString();
        this.ThirdVolumeCtl.Text  = rowFormMaterial.ThirdVolume.ToString();
        this.RemarkCtl.Text       = rowFormMaterial.Remark;

        // 打开明细表
        FormMaterialDetailTableAdapter taDetail = new FormMaterialDetailTableAdapter();

        taDetail.FillByFormMaterialID(this.InnerDS.FormMaterialDetail, formID);
    }
Пример #9
0
        public void AddFormReimburseGoods(int?RejectedFormID, int UserID, int?ProxyUserID, int?ProxyPositionID, int OrganizationUnitID, int PositionID, SystemEnums.FormType FormTypeID,
                                          SystemEnums.FormStatus StatusID, int CustomerID, int PaymentTypeID, string AttachedFileName, string RealAttachedFileName, string Remark, string FormApplyIds, string FormApplyNos, string FlowTemplate)
        {
            SqlTransaction transaction = null;

            try {
                transaction = TableAdapterHelper.BeginTransaction(this.TAForm);
                TableAdapterHelper.SetTransaction(this.TAFormReimburse, transaction);
                TableAdapterHelper.SetTransaction(this.TAFormReimburseDetail, transaction);
                TableAdapterHelper.SetTransaction(this.TAFormReimburseSKUDetail, transaction);

                FormDS.FormRow formRow = this.FormDataSet.Form.NewFormRow();
                if (RejectedFormID != null)
                {
                    formRow.RejectedFormID = RejectedFormID.GetValueOrDefault();
                }
                formRow.UserID = UserID;
                UtilityBLL utility = new UtilityBLL();
                if (StatusID == SystemEnums.FormStatus.Awaiting)
                {
                    string formTypeString = utility.GetFormTypeString((int)FormTypeID);
                    formRow.FormNo = utility.GetFormNo(formTypeString);
                }
                else
                {
                    formRow.SetFormNoNull();
                }
                if (ProxyUserID != null)
                {
                    formRow.ProxyUserID = ProxyUserID.GetValueOrDefault();
                }
                if (ProxyPositionID != null)
                {
                    formRow.ProxyPositionID = ProxyPositionID.GetValueOrDefault();
                }
                formRow.OrganizationUnitID = OrganizationUnitID;
                formRow.PositionID         = PositionID;
                formRow.FormTypeID         = (int)FormTypeID;
                formRow.StatusID           = (int)StatusID;
                formRow.SubmitDate         = DateTime.Now;
                formRow.LastModified       = DateTime.Now;
                formRow.InTurnUserIds      = "P"; //待改动
                formRow.InTurnPositionIds  = "P"; //待改动
                formRow.PageType           = (int)SystemEnums.PageType.ReimburseGoodsApply;
                this.FormDataSet.Form.AddFormRow(formRow);
                this.TAForm.Update(formRow);

                //处理申请表的内容
                FormDS.FormReimburseRow FormReimburseRow = this.FormDataSet.FormReimburse.NewFormReimburseRow();
                FormReimburseRow.FormReimburseID = formRow.FormID;
                FormReimburseRow.CustomerID      = CustomerID;
                FormReimburseRow.PaymentTypeID   = PaymentTypeID;
                FormReimburseRow.Amount          = 0;//默认值
                if (AttachedFileName != null && AttachedFileName != string.Empty)
                {
                    FormReimburseRow.AttachedFileName = AttachedFileName;
                }
                if (RealAttachedFileName != null && RealAttachedFileName != string.Empty)
                {
                    FormReimburseRow.RealAttachedFileName = RealAttachedFileName;
                }
                if (Remark != null && Remark != string.Empty)
                {
                    FormReimburseRow.Remark = Remark;
                }
                FormReimburseRow.FormApplyIds       = FormApplyIds;
                FormReimburseRow.FormApplyNos       = FormApplyNos;
                FormReimburseRow.IsDeliveryComplete = false;

                this.FormDataSet.FormReimburse.AddFormReimburseRow(FormReimburseRow);
                this.TAFormReimburse.Update(FormReimburseRow);


                //处理free goods明细
                if (RejectedFormID != null)
                {
                    FormDS.FormReimburseSKUDetailDataTable newFGTable = new FormDS.FormReimburseSKUDetailDataTable();
                    foreach (FormDS.FormReimburseSKUDetailRow detailFGRow in this.FormDataSet.FormReimburseSKUDetail)
                    {
                        // 与父表绑定
                        if (detailFGRow.RowState != DataRowState.Deleted)
                        {
                            FormDS.FormReimburseSKUDetailRow newDetailFGRow = newFGTable.NewFormReimburseSKUDetailRow();
                            newDetailFGRow.FormReimburseID = FormReimburseRow.FormReimburseID;
                            newDetailFGRow.SKUID           = detailFGRow.SKUID;
                            newDetailFGRow.PackageQuantity = detailFGRow.PackageQuantity;
                            newDetailFGRow.UnitPrice       = detailFGRow.UnitPrice;
                            newDetailFGRow.Quantity        = detailFGRow.Quantity;
                            newDetailFGRow.Amount          = detailFGRow.Amount;

                            if (!detailFGRow.IsRemarkNull())
                            {
                                newDetailFGRow.Remark = detailFGRow.Remark;
                            }
                            newFGTable.AddFormReimburseSKUDetailRow(newDetailFGRow);
                        }
                    }
                    this.TAFormReimburseSKUDetail.Update(newFGTable);
                }
                else
                {
                    foreach (FormDS.FormReimburseSKUDetailRow detailFGRow in this.FormDataSet.FormReimburseSKUDetail)
                    {
                        // 与父表绑定
                        if (detailFGRow.RowState != DataRowState.Deleted)
                        {
                            detailFGRow.FormReimburseID = FormReimburseRow.FormReimburseID;
                        }
                    }
                    this.TAFormReimburseSKUDetail.Update(this.FormDataSet.FormReimburseSKUDetail);
                }

                //明细表
                decimal totalAmount = 0;//计算总申请金额
                FormDS.FormReimburseDetailDataTable newDetailTable = new FormDS.FormReimburseDetailDataTable();
                foreach (FormDS.FormReimburseDetailRow detailRow in this.FormDataSet.FormReimburseDetail)
                {
                    // 与父表绑定
                    if (detailRow.RowState != DataRowState.Deleted)
                    {
                        totalAmount += detailRow.Amount;

                        FormDS.FormReimburseDetailRow newDetailRow = newDetailTable.NewFormReimburseDetailRow();
                        newDetailRow.FormReimburseID          = FormReimburseRow.FormReimburseID;
                        newDetailRow.FormApplyExpenseDetailID = detailRow.FormApplyExpenseDetailID;
                        newDetailRow.ApplyFormNo        = detailRow.ApplyFormNo;
                        newDetailRow.ApplyPeriod        = detailRow.ApplyPeriod;
                        newDetailRow.ShopID             = detailRow.ShopID;
                        newDetailRow.SKUID              = detailRow.SKUID;
                        newDetailRow.ExpenseItemID      = detailRow.ExpenseItemID;
                        newDetailRow.ApplyAmount        = detailRow.ApplyAmount;
                        newDetailRow.RemainAmount       = detailRow.RemainAmount;
                        newDetailRow.Amount             = detailRow.Amount;
                        newDetailRow.ApplyPaymentTypeID = detailRow.ApplyPaymentTypeID;
                        newDetailRow.FormApplyID        = detailRow.FormApplyID;
                        newDetailRow.AccruedAmount      = detailRow.IsAccruedAmountNull() ? 0 : detailRow.AccruedAmount;
                        newDetailTable.AddFormReimburseDetailRow(newDetailRow);
                    }
                }
                this.TAFormReimburseDetail.Update(newDetailTable);
                FormReimburseRow.Amount = totalAmount;
                this.TAFormReimburse.Update(FormReimburseRow);

                //作废之前的单据
                if (RejectedFormID != null)
                {
                    FormDS.FormRow oldRow = this.TAForm.GetDataByID(RejectedFormID.GetValueOrDefault())[0];
                    if (oldRow.StatusID == (int)SystemEnums.FormStatus.Rejected)
                    {
                        oldRow.StatusID = (int)SystemEnums.FormStatus.Scrap;
                        this.TAForm.Update(oldRow);
                    }
                }

                // 正式提交或草稿
                if (StatusID == SystemEnums.FormStatus.Awaiting)
                {
                    Dictionary <string, object> dic = new Dictionary <string, object>();
                    dic["Apply_Amount"] = totalAmount;
                    //dic["Dept"] = new AuthorizationDSTableAdapters.OrganizationUnitTableAdapter().GetOrganizationUnitCodeByOrganizationUnitID(formRow.OrganizationUnitID)[0].OrganizationUnitCode;
                    dic["Expense_Category"] = getExpenseCategoryIDByFormID(int.Parse(FormApplyIds.Split(',')[0])).ToString();//此处待改动
                    APHelper AP = new APHelper();
                    new APFlowBLL().ApplyForm(AP, TAForm, RejectedFormID, formRow, OrganizationUnitID, FlowTemplate, StatusID, dic);
                }

                transaction.Commit();
            } catch (Exception ex) {
                transaction.Rollback();
                throw new ApplicationException("Save Fail!" + ex.ToString());
            } finally {
                transaction.Dispose();
            }
        }
Пример #10
0
        public void UpdateFormBudgetAllocation(int FormID, SystemEnums.FormStatus StatusID, SystemEnums.FormType FormTypeID, string Remark, string AttachFileName, string RealAttachFileName, string FlowTemplate)
        {
            SqlTransaction transaction = null;

            try {
                ////事务开始
                transaction = TableAdapterHelper.BeginTransaction(this.TAForm);
                TableAdapterHelper.SetTransaction(this.TAFormBudgetAllocation, transaction);
                TableAdapterHelper.SetTransaction(this.TAFormBudgetAllocationDetail, transaction);

                FormDS.FormRow formRow = this.TAForm.GetDataByID(FormID)[0];
                UtilityBLL     utility = new UtilityBLL();
                if (StatusID == SystemEnums.FormStatus.Awaiting)
                {
                    string formTypeString = utility.GetFormTypeString((int)FormTypeID);
                    formRow.FormNo            = utility.GetFormNo(formTypeString);
                    formRow.InTurnUserIds     = "P"; //待改动
                    formRow.InTurnPositionIds = "P"; //待改动
                }
                else
                {
                    formRow.SetFormNoNull();
                }
                formRow.StatusID     = (int)StatusID;
                formRow.SubmitDate   = DateTime.Now;
                formRow.LastModified = DateTime.Now;
                this.TAForm.Update(formRow);

                //处理申请表的内容
                FormDS.FormBudgetAllocationRow formBudgetAllocationRow = this.TAFormBudgetAllocation.GetDataByID(FormID)[0];
                formBudgetAllocationRow.Amount             = decimal.Zero;
                formBudgetAllocationRow.AttachFileName     = AttachFileName;
                formBudgetAllocationRow.RealAttachFileName = RealAttachFileName;
                formBudgetAllocationRow.Remark             = Remark;
                this.TAFormBudgetAllocation.Update(formBudgetAllocationRow);

                //明细表
                decimal totalAmount    = 0; //计算总申请金额
                decimal totalInAmount  = 0; //计算调入总金额
                decimal totalOutAmount = 0; //计算调出总金额

                foreach (FormDS.FormBudgetAllocationDetailRow detailRow in this.FormDataSet.FormBudgetAllocationDetail)
                {
                    // 与父表绑定
                    if (detailRow.RowState != DataRowState.Deleted)
                    {
                        detailRow.FormBudgetAllocationID = formBudgetAllocationRow.FormBudgetAllocationID;
                        if (detailRow.AllocationType == (int)SystemEnums.AllocationType.In)
                        {
                            totalInAmount += detailRow.TransferBudget;
                        }
                        else
                        {
                            totalOutAmount += detailRow.TransferBudget;
                        }
                        totalAmount += detailRow.TransferBudget;
                    }
                }

                this.TAFormBudgetAllocationDetail.Update(this.FormDataSet.FormBudgetAllocationDetail);

                formBudgetAllocationRow.Amount = totalOutAmount;
                this.TAFormBudgetAllocation.Update(formBudgetAllocationRow);

                // 正式提交或草稿

                Dictionary <string, object> dic = new Dictionary <string, object>();
                dic["Apply_Amount"] = totalOutAmount;    //调拨金额

                APHelper AP = new APHelper();
                new APFlowBLL().ApplyForm(AP, TAForm, null, formRow, formRow.OrganizationUnitID, FlowTemplate, StatusID, dic);


                transaction.Commit();
            } catch (Exception ex) {
                transaction.Rollback();
                throw new ApplicationException(ex.Message);
            } finally {
                transaction.Dispose();
            }
        }
Пример #11
0
        public void AddFormBudgetAllocation(int?RejectedFormID, int UserID, int?ProxyUserID, int?ProxyPositionID, int OrganizationUnitID, int PositionID, SystemEnums.FormType FormTypeID,
                                            SystemEnums.FormStatus StatusID, string Remark, string AttachFileName, string RealAttachFileName, string FlowTemplate)
        {
            SqlTransaction transaction = null;

            try {
                transaction = TableAdapterHelper.BeginTransaction(this.TAForm);
                TableAdapterHelper.SetTransaction(this.TAFormBudgetAllocation, transaction);
                TableAdapterHelper.SetTransaction(this.TAFormBudgetAllocationDetail, transaction);

                FormDS.FormRow formRow = this.FormDataSet.Form.NewFormRow();
                if (RejectedFormID != null)
                {
                    formRow.RejectedFormID = RejectedFormID.GetValueOrDefault();
                }
                formRow.UserID = UserID;
                UtilityBLL utility = new UtilityBLL();
                if (StatusID == SystemEnums.FormStatus.Awaiting)
                {
                    string formTypeString = utility.GetFormTypeString((int)FormTypeID);
                    formRow.FormNo = utility.GetFormNo(formTypeString);
                }
                else
                {
                    formRow.SetFormNoNull();
                }
                if (ProxyUserID != null)
                {
                    formRow.ProxyUserID = ProxyUserID.GetValueOrDefault();
                }
                if (ProxyPositionID != null)
                {
                    formRow.ProxyPositionID = ProxyPositionID.GetValueOrDefault();
                }
                formRow.OrganizationUnitID = OrganizationUnitID;
                formRow.PositionID         = PositionID;
                formRow.FormTypeID         = (int)FormTypeID;
                formRow.StatusID           = (int)StatusID;
                formRow.SubmitDate         = DateTime.Now;
                formRow.LastModified       = DateTime.Now;
                formRow.InTurnUserIds      = "P"; //待改动
                formRow.InTurnPositionIds  = "P"; //待改动
                formRow.PageType           = (int)SystemEnums.PageType.BudgetAllocationApply;
                this.FormDataSet.Form.AddFormRow(formRow);
                this.TAForm.Update(formRow);

                //处理申请表的内容
                FormDS.FormBudgetAllocationRow formBudgetAllocationRow = this.FormDataSet.FormBudgetAllocation.NewFormBudgetAllocationRow();
                formBudgetAllocationRow.FormBudgetAllocationID = formRow.FormID;
                formBudgetAllocationRow.Amount             = decimal.Zero;
                formBudgetAllocationRow.AttachFileName     = AttachFileName;
                formBudgetAllocationRow.RealAttachFileName = RealAttachFileName;
                formBudgetAllocationRow.Remark             = Remark;


                this.FormDataSet.FormBudgetAllocation.AddFormBudgetAllocationRow(formBudgetAllocationRow);
                this.TAFormBudgetAllocation.Update(formBudgetAllocationRow);

                //明细表
                decimal totalAmount    = 0; //计算总申请金额
                decimal totalInAmount  = 0; //计算调入总金额
                decimal totalOutAmount = 0; //计算调出总金额

                if (RejectedFormID != null)
                {
                    FormDS.FormBudgetAllocationDetailDataTable newDetailTable = new FormDS.FormBudgetAllocationDetailDataTable();
                    foreach (FormDS.FormBudgetAllocationDetailRow detailRow in this.FormDataSet.FormBudgetAllocationDetail)
                    {
                        if (detailRow.RowState != System.Data.DataRowState.Deleted)
                        {
                            FormDS.FormBudgetAllocationDetailRow newDetailRow = newDetailTable.NewFormBudgetAllocationDetailRow();
                            newDetailRow.FormBudgetAllocationID = formBudgetAllocationRow.FormBudgetAllocationID;
                            newDetailRow.CustomerID             = detailRow.CustomerID;
                            newDetailRow.CustomerName           = detailRow.CustomerName;
                            newDetailRow.ExpenseItemID          = detailRow.ExpenseItemID;
                            newDetailRow.ExpenseItemName        = detailRow.ExpenseItemName;
                            newDetailRow.Period           = detailRow.Period;
                            newDetailRow.OriginalBudget   = detailRow.OriginalBudget;
                            newDetailRow.NormalBudget     = detailRow.NormalBudget;
                            newDetailRow.AdjustBudget     = detailRow.AdjustBudget;
                            newDetailRow.TotalBudget      = detailRow.TotalBudget;
                            newDetailRow.TransferBudget   = detailRow.TransferBudget;
                            newDetailRow.AllocationType   = detailRow.AllocationType;
                            newDetailRow.BudgetSalesFeeId = detailRow.BudgetSalesFeeId;
                            totalAmount += newDetailRow.TransferBudget;
                            if (detailRow.AllocationType == (int)SystemEnums.AllocationType.In)
                            {
                                totalInAmount += detailRow.TransferBudget;
                            }
                            else
                            {
                                totalOutAmount += detailRow.TransferBudget;
                            }
                            newDetailTable.AddFormBudgetAllocationDetailRow(newDetailRow);
                        }
                    }
                    this.TAFormBudgetAllocationDetail.Update(newDetailTable);
                }
                else
                {
                    foreach (FormDS.FormBudgetAllocationDetailRow detailRow in this.FormDataSet.FormBudgetAllocationDetail)
                    {
                        // 与父表绑定
                        if (detailRow.RowState != DataRowState.Deleted)
                        {
                            detailRow.FormBudgetAllocationID = formBudgetAllocationRow.FormBudgetAllocationID;
                            if (detailRow.AllocationType == (int)SystemEnums.AllocationType.In)
                            {
                                totalInAmount += detailRow.TransferBudget;
                            }
                            else
                            {
                                totalOutAmount += detailRow.TransferBudget;
                            }
                            totalAmount += detailRow.TransferBudget;
                        }
                    }
                    this.TAFormBudgetAllocationDetail.Update(this.FormDataSet.FormBudgetAllocationDetail);
                }

                formBudgetAllocationRow.Amount = totalOutAmount;
                this.TAFormBudgetAllocation.Update(formBudgetAllocationRow);
                // 正式提交或草稿

                Dictionary <string, object> dic = new Dictionary <string, object>();
                dic["Apply_Amount"] = totalOutAmount;    //调拨金额

                APHelper AP = new APHelper();
                new APFlowBLL().ApplyForm(AP, TAForm, RejectedFormID, formRow, OrganizationUnitID, FlowTemplate, StatusID, dic);

                transaction.Commit();
            } catch (Exception ex) {
                transaction.Rollback();
                throw new ApplicationException(ex.Message);
            } finally {
                transaction.Dispose();
            }
        }
Пример #12
0
        public void AddFormMaterial(int?RejectedFormID, int UserID, int?ProxyUserID, int?ProxyPositionID, int OrganizationUnitID, int PositionID, SystemEnums.FormType FormTypeID,
                                    SystemEnums.FormStatus StatusID, int ShopID, int FirstVolume, int SecondVolume, int ThirdVolume, string Remark, string FlowTemplate)
        {
            SqlTransaction transaction = null;

            try {
                transaction = TableAdapterHelper.BeginTransaction(this.TAForm);
                TableAdapterHelper.SetTransaction(this.TAFormMaterial, transaction);
                TableAdapterHelper.SetTransaction(this.TAFormMaterialDetail, transaction);

                FormDS.FormRow formRow = this.FormDataSet.Form.NewFormRow();
                if (RejectedFormID != null)
                {
                    formRow.RejectedFormID = RejectedFormID.GetValueOrDefault();
                }
                formRow.UserID = UserID;
                UtilityBLL utility = new UtilityBLL();
                if (StatusID == SystemEnums.FormStatus.Awaiting)
                {
                    string formTypeString = utility.GetFormTypeString((int)FormTypeID);
                    formRow.FormNo = utility.GetFormNo(formTypeString);
                }
                else
                {
                    formRow.SetFormNoNull();
                }
                if (ProxyUserID != null)
                {
                    formRow.ProxyUserID = ProxyUserID.GetValueOrDefault();
                }
                if (ProxyPositionID != null)
                {
                    formRow.ProxyPositionID = ProxyPositionID.GetValueOrDefault();
                }
                formRow.OrganizationUnitID = OrganizationUnitID;
                formRow.PositionID         = PositionID;
                formRow.FormTypeID         = (int)FormTypeID;
                formRow.StatusID           = (int)StatusID;
                formRow.SubmitDate         = DateTime.Now;
                formRow.LastModified       = DateTime.Now;
                formRow.InTurnUserIds      = "P"; //待改动
                formRow.InTurnPositionIds  = "P"; //待改动
                formRow.PageType           = (int)SystemEnums.PageType.MaterialApply;
                this.FormDataSet.Form.AddFormRow(formRow);
                this.TAForm.Update(formRow);

                //处理申请表的内容
                FormDS.FormMaterialRow formMaterialRow = this.FormDataSet.FormMaterial.NewFormMaterialRow();
                formMaterialRow.FormMaterialID = formRow.FormID;
                formMaterialRow.ShopID         = ShopID;
                formMaterialRow.FirstVolume    = FirstVolume;
                formMaterialRow.SecondVolume   = SecondVolume;
                formMaterialRow.ThirdVolume    = ThirdVolume;
                formMaterialRow.Amount         = 0;//默认值
                formMaterialRow.Remark         = Remark;

                this.FormDataSet.FormMaterial.AddFormMaterialRow(formMaterialRow);
                this.TAFormMaterial.Update(formMaterialRow);

                //明细表
                decimal totalAmount = 0;//计算总申请金额

                if (RejectedFormID != null)
                {
                    FormDS.FormMaterialDetailDataTable newDetailTable = new FormDS.FormMaterialDetailDataTable();
                    foreach (FormDS.FormMaterialDetailRow detailRow in this.FormDataSet.FormMaterialDetail)
                    {
                        if (detailRow.RowState != System.Data.DataRowState.Deleted)
                        {
                            FormDS.FormMaterialDetailRow newDetailRow = newDetailTable.NewFormMaterialDetailRow();
                            newDetailRow.FormMaterialID = formMaterialRow.FormMaterialID;
                            newDetailRow.MaterialID     = detailRow.MaterialID;
                            ERS.MaterialRow material = new MasterDataBLL().GetMaterialById(detailRow.MaterialID);
                            newDetailRow.MaterialName  = material.MaterialName;
                            newDetailRow.UOM           = material.UOM;
                            newDetailRow.Description   = material.Description;
                            newDetailRow.MaterialPrice = material.MaterialPrice;
                            newDetailRow.Quantity      = detailRow.Quantity;
                            newDetailRow.Amount        = newDetailRow.MaterialPrice * detailRow.Quantity;
                            if (!detailRow.IsRemarkNull())
                            {
                                newDetailRow.Remark = detailRow.Remark;
                            }
                            totalAmount += newDetailRow.Amount;
                            newDetailTable.AddFormMaterialDetailRow(newDetailRow);
                        }
                    }
                    this.TAFormMaterialDetail.Update(newDetailTable);
                }
                else
                {
                    foreach (FormDS.FormMaterialDetailRow detailRow in this.FormDataSet.FormMaterialDetail)
                    {
                        // 与父表绑定
                        if (detailRow.RowState != DataRowState.Deleted)
                        {
                            detailRow.FormMaterialID = formMaterialRow.FormMaterialID;
                            totalAmount += detailRow.Amount;
                        }
                    }
                    this.TAFormMaterialDetail.Update(this.FormDataSet.FormMaterialDetail);
                }

                formMaterialRow.Amount = totalAmount;
                this.TAFormMaterial.Update(formMaterialRow);

                // 正式提交或草稿

                Dictionary <string, object> dic = new Dictionary <string, object>();
                dic["Apply_Amount"] = totalAmount;    //金额
                APHelper AP = new APHelper();
                new APFlowBLL().ApplyForm(AP, TAForm, RejectedFormID, formRow, OrganizationUnitID, FlowTemplate, StatusID, dic);

                transaction.Commit();
            } catch (Exception ex) {
                transaction.Rollback();
                throw new ApplicationException("Save Fail!" + ex.ToString());
            } finally {
                transaction.Dispose();
            }
        }
Пример #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!this.IsPostBack)
        {
            PageUtility.SetContentTitle(this.Page, "广宣物资审批");
            this.Page.Title = "广宣物资审批";

            int formID = int.Parse(Request["ObjectId"]);
            this.ViewState["ObjectId"] = formID;
            FormDS.FormRow         rowForm         = this.MaterialApplyBLL.GetFormByID(formID)[0];
            FormDS.FormMaterialRow rowFormMaterial = this.MaterialApplyBLL.GetFormMaterialByID(formID)[0];
            if (rowForm.IsProcIDNull())
            {
                ViewState["ProcID"] = "";
            }
            else
            {
                ViewState["ProcID"] = rowForm.ProcID;
            }

            ViewState["OrganizationUnitID"] = rowForm.OrganizationUnitID;
            this.FormNoCtl.Text             = rowForm.FormNo;
            this.ApplyDateCtl.Text          = rowForm.SubmitDate.ToShortDateString();
            AuthorizationDS.StuffUserRow applicant = new AuthorizationBLL().GetStuffUserById(rowForm.UserID);
            this.StuffNameCtl.Text    = applicant.StuffName;
            this.PositionNameCtl.Text = new OUTreeBLL().GetPositionById(rowForm.PositionID).PositionName;
            if (new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID) != null)
            {
                this.DepartmentNameCtl.Text = new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID).OrganizationUnitName;
            }
            this.AttendDateCtl.Text = applicant.AttendDate.ToShortDateString();

            ERS.ShopRow shop = new MasterDataBLL().GetShopByID(rowFormMaterial.ShopID);
            this.CustomerNameCtl.Text  = new MasterDataBLL().GetCustomerById(shop.CustomerID).CustomerName;
            this.ShopNameCtl.Text      = shop.ShopName;
            this.FirstVolumeCtl.Text   = rowFormMaterial.FirstVolume.ToString("N");
            this.SecondVolumeCtl.Text  = rowFormMaterial.SecondVolume.ToString("N");
            this.ThirdVolumeCtl.Text   = rowFormMaterial.ThirdVolume.ToString("N");
            this.AverageVolumeCtl.Text = rowFormMaterial.AverageVolume.ToString("N");
            this.RemarkCtl.Text        = rowFormMaterial.Remark;

            this.odsMaterialDetails.SelectParameters["FormMaterialID"].DefaultValue = rowFormMaterial.FormMaterialID.ToString();

            //审批页面处理&按钮处理
            AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
            this.ViewState["StuffUserID"] = stuffUser.StuffUserId;
            if (rowForm.InTurnUserIds.Contains("P" + stuffUser.StuffUserId + "P"))
            {
                this.SubmitBtn.Visible   = true;
                this.cwfAppCheck.IsView  = false;
                this.ViewState["IsView"] = false;
            }
            else
            {
                this.SubmitBtn.Visible   = false;
                this.cwfAppCheck.IsView  = true;
                this.ViewState["IsView"] = true;
            }

            if (rowForm.StatusID == (int)SystemEnums.FormStatus.Rejected && ((AuthorizationDS.StuffUserRow)Session["StuffUser"]).StuffUserId == rowForm.UserID)
            {
                this.EditBtn.Visible  = true;
                this.ScrapBtn.Visible = true;
            }
            else
            {
                this.EditBtn.Visible  = false;
                this.ScrapBtn.Visible = false;
            }

            //如果是弹出,取消按钮不可见
            if (this.Request["ShowDialog"] != null)
            {
                if (this.Request["ShowDialog"].ToString() == "1")
                {
                    this.upButton.Visible = false;
                    this.Master.FindControl("divMenu").Visible       = false;
                    this.Master.FindControl("tbCurrentPage").Visible = false;
                }
            }
        }
        this.cwfAppCheck.FormID = (int)this.ViewState["ObjectId"];
        this.cwfAppCheck.ProcID = this.ViewState["ProcID"].ToString();
        this.cwfAppCheck.IsView = (bool)this.ViewState["IsView"];
    }
Пример #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!this.IsPostBack)
        {
            PageUtility.SetContentTitle(this.Page, "方案申请审批");
            this.Page.Title = "方案申请审批";

            int formID = int.Parse(Request["ObjectId"]);
            this.ViewState["ObjectId"] = formID;
            FormDS.FormRow      rowForm      = this.SalesApplyBLL.GetFormByID(formID)[0];
            FormDS.FormApplyRow rowFormApply = this.SalesApplyBLL.GetFormApplyByID(formID)[0];
            if (rowForm.IsProcIDNull())
            {
                ViewState["ProcID"] = "";
            }
            else
            {
                ViewState["ProcID"] = rowForm.ProcID;
            }
            ViewState["OrganizationUnitID"] = rowForm.OrganizationUnitID;
            this.FormNoCtl.Text             = rowForm.FormNo;
            this.ApplyDateCtl.Text          = rowForm.SubmitDate.ToShortDateString();
            AuthorizationDS.StuffUserRow applicant = new AuthorizationBLL().GetStuffUserById(rowForm.UserID);
            this.StuffNameCtl.Text    = applicant.StuffName;
            this.PositionNameCtl.Text = new OUTreeBLL().GetPositionById(rowForm.PositionID).PositionName;
            if (new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID) != null)
            {
                this.DepartmentNameCtl.Text = new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID).OrganizationUnitName;
            }
            this.AttendDateCtl.Text  = applicant.AttendDate.ToShortDateString();
            this.BeginPeriodCtl.Text = rowFormApply.BeginPeriod.ToShortDateString();
            this.EndPeriodCtl.Text   = rowFormApply.EndPeriod.ToShortDateString();
            MasterDataBLL masterBll = new MasterDataBLL();
            this.ExpenseSubCategoryCtl.Text = masterBll.GetExpenseSubCateNameById(rowFormApply.ExpenseSubCategoryID);
            ERS.CustomerRow customer = masterBll.GetCustomerById(rowFormApply.CustomerID);
            this.CustomerNameCtl.Text = customer.CustomerName;
            this.CustomerTypeCtl.Text = masterBll.GetCustomerTypeById(customer.CustomerTypeID).CustomerTypeName;
            this.ShopNameCtl.Text     = masterBll.GetShopByID(rowFormApply.ShopID).ShopName;
            this.PaymentTypeCtl.Text  = masterBll.GetPaymentTypeById(rowFormApply.PaymentTypeID).PaymentTypeName;
            if (!rowFormApply.IsContractNoNull())
            {
                this.ContractNoCtl.Text = rowFormApply.ContractNo;
            }
            this.AmountCtl.Text = rowFormApply.Amount.ToString("N");
            if (!rowFormApply.IsRemarkNull())
            {
                this.RemarkCtl.Text = rowFormApply.Remark;
            }
            if (!rowFormApply.IsAttachedFileNameNull())
            {
                this.UCFileUpload.AttachmentFileName = rowFormApply.AttachedFileName;
            }
            if (!rowFormApply.IsRealAttachedFileNameNull())
            {
                this.UCFileUpload.RealAttachmentFileName = rowFormApply.RealAttachedFileName;
            }

            //历史单据
            if (rowForm.IsRejectedFormIDNull())
            {
                lblRejectFormNo.Text = "无";
            }
            else
            {
                FormDS.FormRow rejectedForm = new SalesApplyBLL().GetFormByID(rowForm.RejectedFormID)[0];
                this.lblRejectFormNo.Text        = rejectedForm.FormNo;
                this.lblRejectFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/SalesForm/SalesRebateApproval.aspx?ShowDialog=1&ObjectId=" + rejectedForm.FormID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
            }

            //查看预算信息按钮
            this.btnViewBudget.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/ReportManage/SalesFeeByPosition.aspx?ShowDialog=1','', 'dialogWidth:918px;dialogHeight:660px;resizable:yes;')";

            //预算信息
            this.CustomerBudgetCtl.Text       = rowFormApply.CustomerBudget.ToString("N");
            this.CustomerBudgetRemainCtl.Text = rowFormApply.CustomerBudgetRemain.ToString("N");
            this.OUBudgetCtl.Text             = rowFormApply.OUBudget.ToString("N");
            this.OUApprovedAmountCtl.Text     = rowFormApply.OUAppovedAmount.ToString("N");
            this.OUApprovingAmountCtl.Text    = rowFormApply.OUApprovingAmount.ToString("N");
            this.OUCompletedAmountCtl.Text    = rowFormApply.OUCompletedAmount.ToString("N");
            this.OUReimbursedAmountCtl.Text   = rowFormApply.OUReimbursedAmount.ToString("N");
            this.OUBudgetRemainCtl.Text       = rowFormApply.OUBudgetRemain.ToString("N");
            this.OUBudgetRateCtl.Text         = ((decimal)(rowFormApply.OUBudgetRate * 100)).ToString("N") + "%";

            this.odsApplyDetails.SelectParameters["FormID"].DefaultValue = rowFormApply.FormApplyID.ToString();

            //审批页面处理&按钮处理
            AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
            this.ViewState["StuffUserID"] = stuffUser.StuffUserId;
            if (rowForm.InTurnUserIds.Contains("P" + stuffUser.StuffUserId + "P"))
            {
                this.SubmitBtn.Visible   = true;
                this.cwfAppCheck.IsView  = false;
                this.ViewState["IsView"] = false;
            }
            else
            {
                this.SubmitBtn.Visible   = false;
                this.cwfAppCheck.IsView  = true;
                this.ViewState["IsView"] = true;
            }

            if (rowForm.StatusID == (int)SystemEnums.FormStatus.Rejected && stuffUser.StuffUserId == rowForm.UserID)
            {
                this.EditBtn.Visible  = true;
                this.ScrapBtn.Visible = true;
            }
            else
            {
                this.EditBtn.Visible  = false;
                this.ScrapBtn.Visible = false;
            }

            //关闭按钮
            if ((!rowFormApply.IsClose) && rowForm.StatusID == (int)SystemEnums.FormStatus.ApproveCompleted)
            {
                if (stuffUser.StuffUserId == rowForm.UserID || new MasterDataBLL().GetProxyReimburseByParameter(rowForm.UserID, stuffUser.StuffUserId, rowForm.SubmitDate).Count > 0)
                {
                    this.CloseBtn.Visible = true;
                }
                else
                {
                    this.CloseBtn.Visible = false;
                }
            }
            else
            {
                this.CloseBtn.Visible = false;
            }

            //如果是弹出,取消按钮不可见
            if (this.Request["ShowDialog"] != null)
            {
                if (this.Request["ShowDialog"].ToString() == "1")
                {
                    this.upButton.Visible = false;
                    this.Master.FindControl("divMenu").Visible       = false;
                    this.Master.FindControl("tbCurrentPage").Visible = false;
                }
            }
            //如果是申请人则隐藏预算信息
            if (stuffUser.StuffUserId == rowForm.UserID)
            {
                this.OUBudgetCtl.Text           = "";
                this.OUApprovedAmountCtl.Text   = "";
                this.OUApprovingAmountCtl.Text  = "";
                this.OUCompletedAmountCtl.Text  = "";
                this.OUReimbursedAmountCtl.Text = "";
                this.OUBudgetRemainCtl.Text     = "";
                this.OUBudgetRateCtl.Text       = "";
                this.btnViewBudget.Visible      = false;
            }
        }
        this.cwfAppCheck.FormID = (int)this.ViewState["ObjectId"];
        this.cwfAppCheck.ProcID = this.ViewState["ProcID"].ToString();
        this.cwfAppCheck.IsView = (bool)this.ViewState["IsView"];
    }
Пример #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!this.IsPostBack)
        {
            PageUtility.SetContentTitle(this.Page, "方案报销审批");
            this.Page.Title = "方案报销审批";

            int formID = int.Parse(Request["ObjectId"]);
            this.ViewState["ObjectId"] = formID;
            FormDS.FormRow          rowForm          = this.SalesReimburseBLL.GetFormByID(formID)[0];
            FormDS.FormReimburseRow rowFormReimburse = this.SalesReimburseBLL.GetFormReimburseByID(formID)[0];
            //如果单据没有审批完成的话,是不能录入或者查看发货信息的
            if (rowForm.StatusID != (int)SystemEnums.FormStatus.ApproveCompleted)
            {
                this.gvSKUDetails.Columns[6].Visible           = false;
                this.gvSKUDetails.Columns[5].HeaderStyle.Width = 400;
                this.DeliveryDIV.Visible = false;
                this.upDelivery.Visible  = false;
            }
            if (this.gvSKUDetails.SelectedIndex < 0)
            {
                this.fvDelievery.Visible = false;
            }
            //如果没有修改权限的话那么不能新增和删除
            int opManageId = BusinessUtility.GetBusinessOperateId(SystemEnums.BusinessUseCase.DeliveryInfo, SystemEnums.OperateEnum.Manage);
            AuthorizationDS.PositionRow position         = (AuthorizationDS.PositionRow) this.Session["Position"];
            PositionRightBLL            positionRightBLL = new PositionRightBLL();
            this.HasManageRight = positionRightBLL.CheckPositionRight(position.PositionId, opManageId);

            //流程ID
            if (rowForm.IsProcIDNull())
            {
                ViewState["ProcID"] = "";
            }
            else
            {
                ViewState["ProcID"] = rowForm.ProcID;
            }

            ViewState["OrganizationUnitID"] = rowForm.OrganizationUnitID;
            this.FormNoCtl.Text             = rowForm.FormNo;
            this.ApplyDateCtl.Text          = rowForm.SubmitDate.ToShortDateString();
            AuthorizationDS.StuffUserRow applicant = new AuthorizationBLL().GetStuffUserById(rowForm.UserID);
            this.StuffNameCtl.Text    = applicant.StuffName;
            this.PositionNameCtl.Text = new OUTreeBLL().GetPositionById(rowForm.PositionID).PositionName;
            if (new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID) != null)
            {
                this.DepartmentNameCtl.Text = new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID).OrganizationUnitName;
            }
            this.AttendDateCtl.Text = applicant.AttendDate.ToShortDateString();
            MasterDataBLL   masterBll = new MasterDataBLL();
            ERS.CustomerRow customer  = masterBll.GetCustomerById(rowFormReimburse.CustomerID);
            this.CustomerNameCtl.Text = customer.CustomerName;
            this.CustomerTypeCtl.Text = masterBll.GetCustomerTypeById(customer.CustomerTypeID).CustomerTypeName;
            this.PaymentTypeCtl.Text  = masterBll.GetPaymentTypeById(rowFormReimburse.PaymentTypeID).PaymentTypeName;
            if (!rowFormReimburse.IsRemarkNull())
            {
                this.RemarkCtl.Text = rowFormReimburse.Remark;
            }
            if (!rowFormReimburse.IsAttachedFileNameNull())
            {
                this.UCFileUpload.AttachmentFileName = rowFormReimburse.AttachedFileName;
            }
            if (!rowFormReimburse.IsRealAttachedFileNameNull())
            {
                this.UCFileUpload.RealAttachmentFileName = rowFormReimburse.RealAttachedFileName;
            }

            this.odsSKUDetails.SelectParameters["FormReimburseID"].DefaultValue       = rowFormReimburse.FormReimburseID.ToString();
            this.odsReimburseDetails.SelectParameters["FormReimburseID"].DefaultValue = rowFormReimburse.FormReimburseID.ToString();
            //审批页面处理&按钮处理
            AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
            this.ViewState["StuffUserID"] = stuffUser.StuffUserId;
            if (rowForm.InTurnUserIds.Contains("P" + stuffUser.StuffUserId + "P"))
            {
                this.SubmitBtn.Visible   = true;
                this.cwfAppCheck.IsView  = false;
                this.ViewState["IsView"] = false;
            }
            else
            {
                this.SubmitBtn.Visible   = false;
                this.cwfAppCheck.IsView  = true;
                this.ViewState["IsView"] = true;
            }

            if (rowForm.StatusID == (int)SystemEnums.FormStatus.Rejected && stuffUser.StuffUserId == rowForm.UserID)
            {
                this.EditBtn.Visible  = true;
                this.ScrapBtn.Visible = true;
            }
            else
            {
                this.EditBtn.Visible  = false;
                this.ScrapBtn.Visible = false;
            }

            //历史单据
            if (rowForm.IsRejectedFormIDNull())
            {
                lblRejectFormNo.Text = "无";
            }
            else
            {
                FormDS.FormRow rejectedForm = this.SalesReimburseBLL.GetFormByID(rowForm.RejectedFormID)[0];
                this.lblRejectFormNo.Text        = rejectedForm.FormNo;
                this.lblRejectFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/OtherForm/ReimburseGoodsApproval.aspx?ShowDialog=1&ObjectId=" + rejectedForm.FormID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
            }

            //如果是弹出,按钮不可见
            if (this.Request["ShowDialog"] != null)
            {
                if (this.Request["ShowDialog"].ToString() == "1")
                {
                    this.upButton.Visible = false;
                    this.gvSKUDetails.Columns[6].Visible             = false;
                    this.gvSKUDetails.Columns[5].HeaderStyle.Width   = 400;
                    this.Master.FindControl("divMenu").Visible       = false;
                    this.Master.FindControl("tbCurrentPage").Visible = false;
                }
            }

            //发货完成按钮权限
            opManageId = BusinessUtility.GetBusinessOperateId(SystemEnums.BusinessUseCase.DeliveryComplete, SystemEnums.OperateEnum.Other);
            position   = (AuthorizationDS.PositionRow) this.Session["Position"];
            if (positionRightBLL.CheckPositionRight(position.PositionId, opManageId) && (rowFormReimburse.IsIsDeliveryCompleteNull() || rowFormReimburse.IsDeliveryComplete == false))
            {
                this.btnDeliveryComplete.Visible = true;
            }
            else
            {
                this.btnDeliveryComplete.Visible = false;
                //this.gvDelivery.Visible = false;
                //this.gvSKUDetails.Columns[6].Visible=false;
                //this.gvSKUDetails.Columns[5].ItemStyle.Width = 400;
            }
        }
        this.cwfAppCheck.FormID = (int)this.ViewState["ObjectId"];
        this.cwfAppCheck.ProcID = this.ViewState["ProcID"].ToString();
        this.cwfAppCheck.IsView = (bool)this.ViewState["IsView"];
    }
        public void UpdateFormPersonalReimburse(int FormID, SystemEnums.FormStatus StatusID, SystemEnums.FormType FormTypeID, DateTime?Period, string Remark,
                                                string AttachedFileName, string RealAttachedFileName, string FlowTemplate)
        {
            SqlTransaction transaction = null;

            try {
                ////事务开始
                transaction = TableAdapterHelper.BeginTransaction(this.TAForm);
                TableAdapterHelper.SetTransaction(this.TAFormPersonalReimburse, transaction);
                TableAdapterHelper.SetTransaction(this.TAFormPersonalReimburseDetail, transaction);

                FormDS.FormRow formRow = this.TAForm.GetDataByID(FormID)[0];

                decimal[]  calculateAssistant = this.GetPersonalBudgetByParameter(formRow.PositionID, Period);
                UtilityBLL utility            = new UtilityBLL();
                if (StatusID == SystemEnums.FormStatus.Awaiting)
                {
                    string formTypeString = utility.GetFormTypeString((int)FormTypeID);
                    formRow.FormNo            = utility.GetFormNo(formTypeString);
                    formRow.InTurnUserIds     = "P"; //待改动
                    formRow.InTurnPositionIds = "P"; //待改动
                }
                else
                {
                    formRow.SetFormNoNull();
                }
                formRow.StatusID     = (int)StatusID;
                formRow.SubmitDate   = DateTime.Now;
                formRow.LastModified = DateTime.Now;
                this.TAForm.Update(formRow);

                //处理申请表的内容
                FormDS.FormPersonalReimburseRow formPersonalReimburseRow = this.TAFormPersonalReimburse.GetDataByID(FormID)[0];
                formPersonalReimburseRow.FormPersonalReimburseID = formRow.FormID;
                formPersonalReimburseRow.Period = Period.GetValueOrDefault();
                formPersonalReimburseRow.Amount = decimal.Zero;
                formPersonalReimburseRow.Remark = Remark;

                formPersonalReimburseRow.TotalBudget     = calculateAssistant[0];
                formPersonalReimburseRow.ApprovedAmount  = calculateAssistant[1];
                formPersonalReimburseRow.ApprovingAmount = calculateAssistant[2];
                formPersonalReimburseRow.RemainAmount    = calculateAssistant[3];

                if (AttachedFileName != null)
                {
                    formPersonalReimburseRow.AttachedFileName = AttachedFileName;
                }
                if (RealAttachedFileName != null)
                {
                    formPersonalReimburseRow.RealAttachedFileName = RealAttachedFileName;
                }

                this.TAFormPersonalReimburse.Update(formPersonalReimburseRow);

                //明细表
                decimal totalAmount = 0;//计算总申请金额
                foreach (FormDS.FormPersonalReimburseDetailRow detailRow in this.FormDataSet.FormPersonalReimburseDetail)
                {
                    // 与父表绑定
                    if (detailRow.RowState != DataRowState.Deleted)
                    {
                        detailRow.FormPersonalReimburseID = formPersonalReimburseRow.FormPersonalReimburseID;
                        totalAmount += detailRow.Amount;
                    }
                }
                this.TAFormPersonalReimburseDetail.Update(this.FormDataSet.FormPersonalReimburseDetail);

                formPersonalReimburseRow.Amount = totalAmount;
                this.TAFormPersonalReimburse.Update(formPersonalReimburseRow);

                // 正式提交或草稿
                Dictionary <string, object> dic = new Dictionary <string, object>();
                if (StatusID == SystemEnums.FormStatus.Awaiting)
                {
                    if (formPersonalReimburseRow.Amount > calculateAssistant[3])  //如果是减少预算,要做检查
                    {
                        throw new ApplicationException("申请报销总额超出部门可用余额,不能提交!");
                    }
                    dic["Apply_Amount"] = totalAmount;//金额
                    AuthorizationDS.OrganizationUnitDataTable OUTable = new AuthorizationDSTableAdapters.OrganizationUnitTableAdapter().GetOrganizationUnitCodeByOrganizationUnitID(formRow.OrganizationUnitID);
                    if (OUTable.Count == 0)
                    {
                        throw new ApplicationException("没有找到您所在部门的流程,请联系管理员");
                    }
                    dic["Department"] = OUTable[0].OrganizationUnitCode;
                    APHelper AP = new APHelper();
                    new APFlowBLL().ApplyForm(AP, TAForm, null, formRow, formRow.OrganizationUnitID, FlowTemplate, StatusID, dic);
                }
                transaction.Commit();
            } catch (Exception ex) {
                transaction.Rollback();
                throw new ApplicationException(ex.Message);
            } finally {
                transaction.Dispose();
            }
        }
Пример #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!this.IsPostBack)
        {
            PageUtility.SetContentTitle(this.Page, "方案申请审批");
            this.Page.Title = "方案申请审批";

            int formID = int.Parse(Request["ObjectId"]);
            this.ViewState["ObjectId"] = formID;
            FormDS.FormRow      rowForm      = this.SalesApplyBLL.GetFormByID(formID)[0];
            FormDS.FormApplyRow rowFormApply = this.SalesApplyBLL.GetFormApplyByID(formID)[0];
            if (rowForm.IsProcIDNull())
            {
                ViewState["ProcID"] = "";
            }
            else
            {
                ViewState["ProcID"] = rowForm.ProcID;
            }
            ViewState["OrganizationUnitID"] = rowForm.OrganizationUnitID;
            this.FormNoCtl.Text             = rowForm.FormNo;
            this.ApplyDateCtl.Text          = rowForm.SubmitDate.ToShortDateString();
            AuthorizationDS.StuffUserRow applicant = new AuthorizationBLL().GetStuffUserById(rowForm.UserID);
            this.StuffNameCtl.Text    = applicant.StuffName;
            this.PositionNameCtl.Text = new OUTreeBLL().GetPositionById(rowForm.PositionID).PositionName;
            if (new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID) != null)
            {
                this.DepartmentNameCtl.Text = new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID).OrganizationUnitName;
            }
            this.AttendDateCtl.Text  = applicant.AttendDate.ToShortDateString();
            this.BeginPeriodCtl.Text = rowFormApply.BeginPeriod.ToString("yyyy-MM");
            this.EndPeriodCtl.Text   = rowFormApply.EndPeriod.ToString("yyyy-MM");
            MasterDataBLL masterBll = new MasterDataBLL();
            this.ExpenseSubCategoryCtl.Text = masterBll.GetExpenseSubCateNameById(rowFormApply.ExpenseSubCategoryID);
            ERS.CustomerRow customer = masterBll.GetCustomerById(rowFormApply.CustomerID);
            this.CustomerNameCtl.Text = customer.CustomerName;
            //this.CustomerTypeCtl.Text = masterBll.GetCustomerTypeById(customer.CustomerTypeID).CustomerTypeName;
            this.ShopNameCtl.Text    = masterBll.GetShopByID(rowFormApply.ShopID).ShopName;
            this.PaymentTypeCtl.Text = masterBll.GetPaymentTypeById(rowFormApply.PaymentTypeID).PaymentTypeName;
            if (!rowFormApply.IsContractNoNull())
            {
                this.ContractNoCtl.Text = rowFormApply.ContractNo;
            }
            this.AmountCtl.Text = rowFormApply.Amount.ToString("N");
            if (!rowFormApply.IsRemarkNull())
            {
                this.RemarkCtl.Text = rowFormApply.Remark;
            }
            if (!rowFormApply.IsAttachedFileNameNull())
            {
                this.UCFileUpload.AttachmentFileName = rowFormApply.AttachedFileName;
            }
            if (!rowFormApply.IsRealAttachedFileNameNull())
            {
                this.UCFileUpload.RealAttachmentFileName = rowFormApply.RealAttachedFileName;
            }

            if (!rowFormApply.IsPromotionBeginDateNull())
            {
                this.PromotionBeginCtl.Text = rowFormApply.PromotionBeginDate.ToString("yyyy-MM-dd");
            }
            if (!rowFormApply.IsPromotionEndDateNull())
            {
                this.PromotionEndCtl.Text = rowFormApply.PromotionEndDate.ToString("yyyy-MM-dd");
            }
            if (!rowFormApply.IsDeliveryBeginDateNull())
            {
                this.DeliveryBeginCtl.Text = rowFormApply.DeliveryBeginDate.ToString("yyyy-MM-dd");
            }
            if (!rowFormApply.IsDeliveryEndDateNull())
            {
                this.DeliveryEndCtl.Text = rowFormApply.DeliveryEndDate.ToString("yyyy-MM-dd");
            }
            if (!rowFormApply.IsFormApplyNameNull())
            {
                this.txtFormApplyName.Text = rowFormApply.FormApplyName;
            }
            this.PromotionScopeCtl.Text = masterBll.GetPromotionScopeById(rowFormApply.PromotionScopeID).PromotionScopeName;
            this.PromotionTypeCtl.Text  = masterBll.GetPromotionTypeById(rowFormApply.PromotionTypeID).PromotionTypeName;
            if (!rowFormApply.IsPromotionDescNull())
            {
                this.PromotionDescCtl.Text = rowFormApply.PromotionDesc;
            }
            this.ShelfTypeCtl.Text = masterBll.GetShelfTypeById(rowFormApply.ShelfTypeID).ShelfTypeName;
            if (!rowFormApply.IsFirstVolumeNull())
            {
                this.FirstVolumeCtl.Text = rowFormApply.FirstVolume.ToString();
            }
            if (!rowFormApply.IsSecondVolumeNull())
            {
                this.SecondVolumeCtl.Text = rowFormApply.SecondVolume.ToString();
            }
            if (!rowFormApply.IsThirdVolumeNull())
            {
                this.ThirdVolumeCtl.Text = rowFormApply.ThirdVolume.ToString();
            }
            if (!rowFormApply.IsAverageVolumeNull())
            {
                this.AverageVolumeCtl.Text = rowFormApply.AverageVolume.ToString();
            }

            if (!rowFormApply.IsReimburseRequirementsNull())
            {
                int ReimburseRequirement = rowFormApply.ReimburseRequirements;
                if ((ReimburseRequirement & (int)SystemEnums.ReimburseRequirements.Picture) == (int)SystemEnums.ReimburseRequirements.Picture)
                {
                    chkListReimburseRequirements.Items[0].Selected = true;
                }
                if ((ReimburseRequirement & (int)SystemEnums.ReimburseRequirements.Agreement) == (int)SystemEnums.ReimburseRequirements.Agreement)
                {
                    chkListReimburseRequirements.Items[1].Selected = true;
                }
                if ((ReimburseRequirement & (int)SystemEnums.ReimburseRequirements.DeliveryOrder) == (int)SystemEnums.ReimburseRequirements.DeliveryOrder)
                {
                    chkListReimburseRequirements.Items[2].Selected = true;
                }
                if ((ReimburseRequirement & (int)SystemEnums.ReimburseRequirements.Contract) == (int)SystemEnums.ReimburseRequirements.Contract)
                {
                    chkListReimburseRequirements.Items[3].Selected = true;
                }
                if ((ReimburseRequirement & (int)SystemEnums.ReimburseRequirements.DM) == (int)SystemEnums.ReimburseRequirements.DM)
                {
                    chkListReimburseRequirements.Items[4].Selected = true;
                }
                if ((ReimburseRequirement & (int)SystemEnums.ReimburseRequirements.Other) == (int)SystemEnums.ReimburseRequirements.Other)
                {
                    chkListReimburseRequirements.Items[5].Selected = true;
                }
            }

            //历史单据
            if (rowForm.IsRejectedFormIDNull())
            {
                lblRejectFormNo.Text = "无";
            }
            else
            {
                FormDS.FormRow rejectedForm = new SalesApplyBLL().GetFormByID(rowForm.RejectedFormID)[0];
                this.lblRejectFormNo.Text        = rejectedForm.FormNo;
                this.lblRejectFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/SalesForm/SalesGeneralApproval.aspx?ShowDialog=1&ObjectId=" + rejectedForm.FormID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
            }

            //查看预算信息按钮
            this.btnViewBudget.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/ReportManage/SalesBudgetByPosition.aspx?ShowDialog=1','', 'dialogWidth:918px;dialogHeight:660px;resizable:yes;')";

            //预算信息
            this.CustomerBudgetCtl.Text       = rowFormApply.CustomerBudget.ToString("N");
            this.CustomerBudgetRemainCtl.Text = rowFormApply.CustomerBudgetRemain.ToString("N");
            this.OUBudgetCtl.Text             = rowFormApply.OUBudget.ToString("N");
            this.OUApprovedAmountCtl.Text     = rowFormApply.OUAppovedAmount.ToString("N");
            this.OUApprovingAmountCtl.Text    = rowFormApply.OUApprovingAmount.ToString("N");
            this.OUCompletedAmountCtl.Text    = rowFormApply.OUCompletedAmount.ToString("N");
            this.OUReimbursedAmountCtl.Text   = rowFormApply.OUReimbursedAmount.ToString("N");
            this.OUBudgetRemainCtl.Text       = rowFormApply.OUBudgetRemain.ToString("N");
            this.OUBudgetRateCtl.Text         = ((decimal)(rowFormApply.OUBudgetRate * 100)).ToString("N") + "%";

            this.odsSKU.SelectParameters["FormApplyID"].DefaultValue = rowFormApply.FormApplyID.ToString();

            //审批页面处理&按钮处理
            AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
            this.ViewState["StuffUserID"] = stuffUser.StuffUserId;
            if (rowForm.InTurnUserIds.Contains("P" + stuffUser.StuffUserId + "P"))
            {
                this.SubmitBtn.Visible   = true;
                this.cwfAppCheck.IsView  = false;
                this.ViewState["IsView"] = false;
            }
            else
            {
                this.SubmitBtn.Visible   = false;
                this.cwfAppCheck.IsView  = true;
                this.ViewState["IsView"] = true;
            }

            if (rowForm.StatusID == (int)SystemEnums.FormStatus.Rejected && stuffUser.StuffUserId == rowForm.UserID)
            {
                this.EditBtn.Visible  = true;
                this.ScrapBtn.Visible = true;
            }
            else
            {
                this.EditBtn.Visible  = false;
                this.ScrapBtn.Visible = false;
            }

            //是否显示复制按钮
            if (rowForm.StatusID == (int)SystemEnums.FormStatus.ApproveCompleted && stuffUser.StuffUserId == rowForm.UserID)
            {
                this.UCBeginPeriod.Visible = true;
                this.UCEndPeriod.Visible   = true;
                this.lblSignal.Visible     = true;
                this.CopyBtn.Visible       = true;
            }
            else
            {
                this.UCBeginPeriod.Visible = false;
                this.UCEndPeriod.Visible   = false;
                this.lblSignal.Visible     = false;
                this.CopyBtn.Visible       = false;
            }
            //是否显示打印信息
            if (((stuffUser.StuffUserId == rowForm.UserID || base.IsBusinessProxy(rowForm.UserID, rowForm.SubmitDate) && (rowForm.StatusID == (int)SystemEnums.FormStatus.ApproveCompleted) || rowForm.StatusID == (int)SystemEnums.FormStatus.Scrap && rowFormApply.IsAutoSplit)))
            {
                this.PrintBtn.Visible = true;
            }
            else
            {
                this.PrintBtn.Visible = false;
            }

            if (rowForm.StatusID == (int)SystemEnums.FormStatus.ApproveCompleted || (rowForm.StatusID == (int)SystemEnums.FormStatus.Scrap && rowFormApply.IsAutoSplit))
            {
                this.PrintInfor.Visible = true;
                int printCount = rowFormApply.IsPrintCountNull() ? 0 : rowFormApply.PrintCount;
                this.PrintInfor.Text = "该方案已经被打印" + printCount + "次";
            }
            else
            {
                this.PrintInfor.Visible = false;
            }

            //如果是弹出,取消按钮不可见
            if (this.Request["ShowDialog"] != null)
            {
                if (this.Request["ShowDialog"].ToString() == "1")
                {
                    this.upButton.Visible = false;
                    this.Master.FindControl("divMenu").Visible       = false;
                    this.Master.FindControl("tbCurrentPage").Visible = false;
                    this.PrintInfor.Visible = false;
                    this.PrintBtn.Visible   = false;
                }
            }
            //如果是申请人则隐藏预算信息
            if (stuffUser.StuffUserId == rowForm.UserID)
            {
                this.OUBudgetCtl.Text           = "";
                this.OUApprovedAmountCtl.Text   = "";
                this.OUApprovingAmountCtl.Text  = "";
                this.OUCompletedAmountCtl.Text  = "";
                this.OUReimbursedAmountCtl.Text = "";
                this.OUBudgetRemainCtl.Text     = "";
                this.OUBudgetRateCtl.Text       = "";
                this.btnViewBudget.Visible      = false;
            }
            //分摊比例
            new FormApplySplitRateTableAdapter().FillByApplyID(InnerDS.FormApplySplitRate, formID);
            if (InnerDS.FormApplySplitRate != null && InnerDS.FormApplySplitRate.Count > 0)
            {
                this.divSplitRate.Visible   = true;
                this.gvSplitRate.Visible    = true;
                this.gvSplitRate.DataSource = InnerDS.FormApplySplitRate;
                this.gvSplitRate.DataBind();
            }
        }
        this.cwfAppCheck.FormID = (int)this.ViewState["ObjectId"];
        this.cwfAppCheck.ProcID = this.ViewState["ProcID"].ToString();
        this.cwfAppCheck.IsView = (bool)this.ViewState["IsView"];
    }
Пример #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!this.IsPostBack)
        {
            PageUtility.SetContentTitle(this.Page, "预算调拨审批");
            this.Page.Title = "预算调拨审批";

            int formID = int.Parse(Request["ObjectId"]);
            this.ViewState["ObjectId"] = formID;

            FormDS.FormRow rowForm = this.BudgetAllocationApplyBLL.GetFormByID(formID)[0];
            FormDS.FormBudgetAllocationRow rowBudgetAllocation = this.BudgetAllocationApplyBLL.GetFormBudgetAllocationByID(formID)[0];

            if (rowForm.IsProcIDNull())
            {
                ViewState["ProcID"] = "";
            }
            else
            {
                ViewState["ProcID"] = rowForm.ProcID;
            }

            ViewState["OrganizationUnitID"] = rowForm.OrganizationUnitID;
            //对控件进行赋值
            this.txtFormNo.Text    = rowForm.FormNo;
            this.ApplyDateCtl.Text = rowForm.SubmitDate.ToShortDateString();
            AuthorizationDS.StuffUserRow applicant = new AuthorizationBLL().GetStuffUserById(rowForm.UserID);
            this.StuffNameCtl.Text    = applicant.StuffName;
            this.PositionNameCtl.Text = new OUTreeBLL().GetPositionById(rowForm.PositionID).PositionName;
            if (new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID) != null)
            {
                this.DepartmentNameCtl.Text = new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID).OrganizationUnitName;
            }
            this.AttendDateCtl.Text = applicant.AttendDate.ToShortDateString();
            this.RemarkCtl.Text     = rowBudgetAllocation.Remark;

            this.odsBudgetAllocationInDetails.SelectParameters["FormBudgetAllocationID"].DefaultValue  = rowBudgetAllocation.FormBudgetAllocationID.ToString();
            this.odsBudgetAllocationOutDetails.SelectParameters["FormBudgetAllocationID"].DefaultValue = rowBudgetAllocation.FormBudgetAllocationID.ToString();

            //历史单据
            if (rowForm.IsRejectedFormIDNull())
            {
                lblRejectFormNo.Text = "无";
            }
            else
            {
                FormDS.FormRow rejectedForm = new BudgetAllocationApplyBLL().GetFormByID(rowForm.RejectedFormID)[0];
                this.lblRejectFormNo.Text        = rejectedForm.FormNo;
                this.lblRejectFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/OtherForm/BudgetAllocationApproval.aspx?ShowDialog=1&ObjectId=" + rejectedForm.FormID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
            }

            //审批页面处理&按钮处理
            AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
            this.ViewState["StuffUserID"] = stuffUser.StuffUserId;
            if (rowForm.InTurnUserIds.Contains("P" + stuffUser.StuffUserId + "P"))
            {
                this.SubmitBtn.Visible   = true;
                this.cwfAppCheck.IsView  = false;
                this.ViewState["IsView"] = false;
            }
            else
            {
                this.SubmitBtn.Visible   = false;
                this.cwfAppCheck.IsView  = true;
                this.ViewState["IsView"] = true;
            }

            if (rowForm.StatusID == (int)SystemEnums.FormStatus.Rejected && ((AuthorizationDS.StuffUserRow)Session["StuffUser"]).StuffUserId == rowForm.UserID)
            {
                this.EditBtn.Visible  = true;
                this.ScrapBtn.Visible = true;
            }
            else
            {
                this.EditBtn.Visible  = false;
                this.ScrapBtn.Visible = false;
            }

            //如果是弹出,按钮不可见
            if (this.Request["ShowDialog"] != null)
            {
                if (this.Request["ShowDialog"].ToString() == "1")
                {
                    this.upButton.Visible = false;
                    this.Master.FindControl("divMenu").Visible       = false;
                    this.Master.FindControl("tbCurrentPage").Visible = false;
                }
            }
            this.cwfAppCheck.FormID = (int)this.ViewState["ObjectId"];
            this.cwfAppCheck.ProcID = this.ViewState["ProcID"].ToString();
            this.cwfAppCheck.IsView = (bool)this.ViewState["IsView"];
        }
    }
Пример #19
0
        public void UpdateFormReimburseGoods(int FormID, SystemEnums.FormStatus StatusID, SystemEnums.FormType FormTypeID,
                                             string AttachedFileName, string RealAttachedFileName, string Remark, string FlowTemplate)
        {
            SqlTransaction transaction = null;

            try {
                //事务开始
                transaction = TableAdapterHelper.BeginTransaction(this.TAForm);
                TableAdapterHelper.SetTransaction(this.TAFormReimburse, transaction);
                TableAdapterHelper.SetTransaction(this.TAFormReimburseDetail, transaction);
                TableAdapterHelper.SetTransaction(this.TAFormReimburseSKUDetail, transaction);

                FormDS.FormRow          formRow          = this.TAForm.GetDataByID(FormID)[0];
                FormDS.FormReimburseRow FormReimburseRow = this.TAFormReimburse.GetDataByID(FormID)[0];

                //处理单据的内容
                UtilityBLL utility = new UtilityBLL();
                if (StatusID == SystemEnums.FormStatus.Awaiting)
                {
                    string formTypeString = utility.GetFormTypeString((int)FormTypeID);
                    formRow.FormNo = utility.GetFormNo(formTypeString);
                }
                else
                {
                    formRow.SetFormNoNull();
                }
                formRow.StatusID     = (int)StatusID;
                formRow.SubmitDate   = DateTime.Now;
                formRow.LastModified = DateTime.Now;

                this.TAForm.Update(formRow);

                //处理FormReimburseRow的内容
                if (AttachedFileName != null && AttachedFileName != string.Empty)
                {
                    FormReimburseRow.AttachedFileName = AttachedFileName;
                }
                else
                {
                    FormReimburseRow.SetAttachedFileNameNull();
                }
                if (RealAttachedFileName != null && RealAttachedFileName != string.Empty)
                {
                    FormReimburseRow.RealAttachedFileName = RealAttachedFileName;
                }
                else
                {
                    FormReimburseRow.SetRealAttachedFileNameNull();
                }
                if (Remark != null && Remark != string.Empty)
                {
                    FormReimburseRow.Remark = Remark;
                }

                this.TAFormReimburse.Update(FormReimburseRow);

                //处理free goods明细
                foreach (FormDS.FormReimburseSKUDetailRow detailFGRow in this.FormDataSet.FormReimburseSKUDetail)
                {
                    // 与父表绑定
                    if (detailFGRow.RowState != DataRowState.Deleted)
                    {
                        detailFGRow.FormReimburseID = FormReimburseRow.FormReimburseID;
                    }
                }
                this.TAFormReimburseSKUDetail.Update(this.FormDataSet.FormReimburseSKUDetail);

                //处理明细
                decimal totalAmount = 0;
                foreach (FormDS.FormReimburseDetailRow detailRow in this.FormDataSet.FormReimburseDetail)
                {
                    if (detailRow.RowState != DataRowState.Deleted)
                    {
                        totalAmount += detailRow.Amount;
                        detailRow.FormReimburseID = FormReimburseRow.FormReimburseID;
                    }
                }
                this.TAFormReimburseDetail.Update(this.FormDataSet.FormReimburseDetail);

                FormReimburseRow.Amount = totalAmount;
                this.TAFormReimburse.Update(FormReimburseRow);

                // 正式提交
                if (StatusID == SystemEnums.FormStatus.Awaiting)
                {
                    Dictionary <string, object> dic = new Dictionary <string, object>();
                    dic["Apply_Amount"] = totalAmount;
                    //dic["Dept"] = new AuthorizationDSTableAdapters.OrganizationUnitTableAdapter().GetOrganizationUnitCodeByOrganizationUnitID(formRow.OrganizationUnitID)[0].OrganizationUnitCode;
                    dic["Expense_Category"] = getExpenseCategoryIDByFormID(int.Parse(FormReimburseRow.FormApplyIds.Split(',')[0])).ToString();//此处待改动
                    APHelper AP = new APHelper();
                    new APFlowBLL().ApplyForm(AP, TAForm, null, formRow, formRow.OrganizationUnitID, FlowTemplate, StatusID, dic);
                }
                transaction.Commit();
            } catch (Exception ex) {
                transaction.Rollback();
                throw new ApplicationException("Save Fail!" + ex.ToString());
            } finally {
                transaction.Dispose();
            }
        }
Пример #20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!this.IsPostBack)
        {
            PageUtility.SetContentTitle(this.Page, "合同审批");
            this.Page.Title = "合同审批";

            int formID = int.Parse(Request["ObjectId"]);
            this.ViewState["ObjectId"] = formID;
            FormDS.FormRow         rowForm         = this.ContractApplyBLL.GetFormByID(formID)[0];
            FormDS.FormContractRow rowFormContract = this.ContractApplyBLL.GetFormContractByID(formID)[0];
            if (rowForm.IsProcIDNull())
            {
                ViewState["ProcID"] = "";
            }
            else
            {
                ViewState["ProcID"] = rowForm.ProcID;
            }

            ViewState["OrganizationUnitID"] = rowForm.OrganizationUnitID;
            //对控件赋值
            this.txtFormNo.Text    = rowForm.FormNo;
            this.ApplyDateCtl.Text = rowForm.SubmitDate.ToShortDateString();
            AuthorizationDS.StuffUserRow applicant = new AuthorizationBLL().GetStuffUserById(rowForm.UserID);
            this.StuffNameCtl.Text    = applicant.StuffName;
            this.PositionNameCtl.Text = new OUTreeBLL().GetPositionById(rowForm.PositionID).PositionName;
            if (new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID) != null)
            {
                this.DepartmentNameCtl.Text = new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID).OrganizationUnitName;
            }
            this.AttendDateCtl.Text = applicant.AttendDate.ToShortDateString();

            this.txtContractName.Text = rowFormContract.ContractName;
            this.txtFirstCompany.Text = rowFormContract.FirstCompany;
            if (!rowFormContract.IsSecondCompanyNull())
            {
                this.txtSecondCompany.Text = rowFormContract.SecondCompany;
            }
            if (!rowFormContract.IsThirdCompanyNull())
            {
                this.txtThirdCompany.Text = rowFormContract.ThirdCompany;
            }
            this.txtContractNo.Text     = rowFormContract.ContractNo;
            this.txtContractAmount.Text = rowFormContract.ContractAmount.ToString();
            this.txtPageNumber.Text     = rowFormContract.PageNumber.ToString();
            this.txtContractType.Text   = new MasterDataBLL().GetContractTypeById(rowFormContract.ContractTypeID).ContractTypeName;
            if (!rowFormContract.IsPaymentTypeNull())
            {
                this.txtPaymentType.Text = rowFormContract.PaymentType;
            }
            if (!rowFormContract.IsBeginDateNull())
            {
                this.txtBeginDate.Text = rowFormContract.BeginDate.ToShortDateString();
            }
            if (!rowFormContract.IsEndDateNull())
            {
                this.txtEndDate.Text = rowFormContract.EndDate.ToShortDateString();
            }
            if (!rowFormContract.IsMainContentNull())
            {
                this.txtMainContent.Text = rowFormContract.MainContent;
            }
            if (!rowFormContract.IsChangePartNull())
            {
                this.txtChangePart.Text = rowFormContract.ChangePart;
            }
            if (!rowFormContract.IsAttachedFileNameNull())
            {
                this.UCFileUpload.AttachmentFileName = rowFormContract.AttachedFileName;
            }
            if (!rowFormContract.IsRealAttachedFileNameNull())
            {
                this.UCFileUpload.RealAttachmentFileName = rowFormContract.RealAttachedFileName;
            }

            //历史单据
            if (rowForm.IsRejectedFormIDNull())
            {
                lblRejectFormNo.Text = "无";
                trHistory.Visible    = false;
            }
            else
            {
                FormDS.FormRow rejectedForm = new ContractApplyBLL().GetFormByID(rowForm.RejectedFormID)[0];
                this.lblRejectFormNo.Text        = rejectedForm.FormNo;
                this.lblRejectFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/OtherForm/ContractApproval.aspx?ShowDialog=1&ObjectId=" + rejectedForm.FormID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
            }

            //审批页面处理&按钮处理
            AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
            this.ViewState["StuffUserID"] = stuffUser.StuffUserId;
            if (rowForm.InTurnUserIds.Contains("P" + stuffUser.StuffUserId + "P"))
            {
                this.SubmitBtn.Visible   = true;
                this.cwfAppCheck.IsView  = false;
                this.ViewState["IsView"] = false;
            }
            else
            {
                this.SubmitBtn.Visible   = false;
                this.cwfAppCheck.IsView  = true;
                this.ViewState["IsView"] = true;
            }

            if (rowForm.StatusID == (int)SystemEnums.FormStatus.Rejected && ((AuthorizationDS.StuffUserRow)Session["StuffUser"]).StuffUserId == rowForm.UserID)
            {
                this.EditBtn.Visible  = true;
                this.ScrapBtn.Visible = true;
            }
            else
            {
                this.EditBtn.Visible  = false;
                this.ScrapBtn.Visible = false;
            }

            //如果是弹出,取消按钮不可见
            if (this.Request["ShowDialog"] != null)
            {
                if (this.Request["ShowDialog"].ToString() == "1")
                {
                    this.upButton.Visible = false;
                    this.Master.FindControl("divMenu").Visible       = false;
                    this.Master.FindControl("tbCurrentPage").Visible = false;
                }
            }

            //判断是否盖章
            this.IsStampCtl.Checked    = rowFormContract.IsisStampedNull() ? false : rowFormContract.isStamped;
            this.IsRecoveryCtl.Checked = rowFormContract.IsisRecoveryNull() ? false : rowFormContract.isRecovery;
            int opContractInfoId = BusinessUtility.GetBusinessOperateId(SystemEnums.BusinessUseCase.FormContract, SystemEnums.OperateEnum.Other);
            AuthorizationDS.PositionRow ViewerPosition = (AuthorizationDS.PositionRow) this.Session["Position"];
            if (new PositionRightBLL().CheckPositionRight(ViewerPosition.PositionId, opContractInfoId) && rowForm.StatusID == 2)
            {
                if (!rowFormContract.IsisStampedNull() && rowFormContract.isStamped)
                {
                    this.StampBtn.Visible = false;
                }
                else
                {
                    this.StampBtn.Visible = true;
                }
                if (!rowFormContract.IsisRecoveryNull() && rowFormContract.isRecovery)
                {
                    this.RecoveryBtn.Visible = false;
                }
                else
                {
                    this.RecoveryBtn.Visible = true;
                }
            }
            else
            {
                this.StampBtn.Visible    = false;
                this.RecoveryBtn.Visible = false;
            }
        }

        this.cwfAppCheck.FormID = (int)this.ViewState["ObjectId"];
        this.cwfAppCheck.ProcID = this.ViewState["ProcID"].ToString();
        this.cwfAppCheck.IsView = (bool)this.ViewState["IsView"];
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!this.IsPostBack)
        {
            PageUtility.SetContentTitle(this.Page, "方案执行确认");
            this.Page.Title = "方案执行确认";

            int formID = int.Parse(Request["ObjectId"]);
            this.ViewState["ObjectId"] = formID;
            FormDS.FormRow      rowForm      = this.SalesApplyBLL.GetFormByID(formID)[0];
            FormDS.FormApplyRow rowFormApply = this.SalesApplyBLL.GetFormApplyByID(formID)[0];
            if (rowForm.IsProcIDNull())
            {
                ViewState["ProcID"] = "";
            }
            else
            {
                ViewState["ProcID"] = rowForm.ProcID;
            }

            ViewState["OrganizationUnitID"] = rowForm.OrganizationUnitID;
            this.FormNoCtl.Text             = rowForm.FormNo;
            this.ApplyDateCtl.Text          = rowForm.SubmitDate.ToShortDateString();
            AuthorizationDS.StuffUserRow applicant = new AuthorizationBLL().GetStuffUserById(rowForm.UserID);
            this.StuffNameCtl.Text    = applicant.StuffName;
            this.PositionNameCtl.Text = new OUTreeBLL().GetPositionById(rowForm.PositionID).PositionName;
            if (new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID) != null)
            {
                this.DepartmentNameCtl.Text = new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID).OrganizationUnitName;
            }
            this.AttendDateCtl.Text  = applicant.AttendDate.ToShortDateString();
            this.BeginPeriodCtl.Text = rowFormApply.BeginPeriod.ToString("yyyy-MM");
            this.EndPeriodCtl.Text   = rowFormApply.EndPeriod.ToString("yyyy-MM");
            MasterDataBLL masterBll = new MasterDataBLL();
            this.ExpenseSubCategoryCtl.Text = masterBll.GetExpenseSubCateNameById(rowFormApply.ExpenseSubCategoryID);
            ERS.CustomerRow customer = masterBll.GetCustomerById(rowFormApply.CustomerID);
            this.CustomerNameCtl.Text = customer.CustomerName;
            //this.CustomerTypeCtl.Text = masterBll.GetCustomerTypeById(customer.CustomerTypeID).CustomerTypeName;
            this.ShopNameCtl.Text    = masterBll.GetShopByID(rowFormApply.ShopID).ShopName;
            this.PaymentTypeCtl.Text = masterBll.GetPaymentTypeById(rowFormApply.PaymentTypeID).PaymentTypeName;
            if (!rowFormApply.IsContractNoNull())
            {
                this.ContractNoCtl.Text = rowFormApply.ContractNo;
            }
            this.AmountCtl.Text = rowFormApply.Amount.ToString("N");
            if (!rowFormApply.IsRemarkNull())
            {
                this.RemarkCtl.Text = rowFormApply.Remark;
            }
            if (!rowFormApply.IsAttachedFileNameNull())
            {
                this.UCFileUpload.AttachmentFileName = rowFormApply.AttachedFileName;
            }
            if (!rowFormApply.IsRealAttachedFileNameNull())
            {
                this.UCFileUpload.RealAttachmentFileName = rowFormApply.RealAttachedFileName;
            }

            if (!rowFormApply.IsPromotionBeginDateNull())
            {
                this.PromotionBeginCtl.Text = rowFormApply.PromotionBeginDate.ToString("yyyy-MM-dd");
            }
            if (!rowFormApply.IsPromotionEndDateNull())
            {
                this.PromotionEndCtl.Text = rowFormApply.PromotionEndDate.ToString("yyyy-MM-dd");
            }
            this.PromotionScopeCtl.Text = masterBll.GetPromotionScopeById(rowFormApply.PromotionScopeID).PromotionScopeName;
            this.PromotionTypeCtl.Text  = masterBll.GetPromotionTypeById(rowFormApply.PromotionTypeID).PromotionTypeName;
            if (!rowFormApply.IsPromotionDescNull())
            {
                this.PromotionDescCtl.Text = rowFormApply.PromotionDesc;
            }
            this.ShelfTypeCtl.Text = masterBll.GetShelfTypeById(rowFormApply.ShelfTypeID).ShelfTypeName;
            if (!rowFormApply.IsFirstVolumeNull())
            {
                this.FirstVolumeCtl.Text = rowFormApply.FirstVolume.ToString();
            }
            if (!rowFormApply.IsSecondVolumeNull())
            {
                this.SecondVolumeCtl.Text = rowFormApply.SecondVolume.ToString();
            }
            if (!rowFormApply.IsThirdVolumeNull())
            {
                this.ThirdVolumeCtl.Text = rowFormApply.ThirdVolume.ToString();
            }
            if (!rowFormApply.IsAverageVolumeNull())
            {
                this.AverageVolumeCtl.Text = rowFormApply.AverageVolume.ToString();
            }
            if (!rowFormApply.IsEstimatedSaleVolumeNull())
            {
                this.txtEstimatedSaleVolume.Text = rowFormApply.EstimatedSaleVolume.ToString();
            }
            if (!rowFormApply.IsPackageUnitPriceNull())
            {
                this.txtPackageUnitPrice.Text = rowFormApply.PackageUnitPrice.ToString("N");
            }
            if (!rowFormApply.IsFormApplyNameNull())
            {
                this.txtFormApplyName.Text = rowFormApply.FormApplyName;
            }

            //查看预算信息按钮
            this.btnViewBudget.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/ReportManage/SalesBudgetByPosition.aspx?ShowDialog=1','', 'dialogWidth:1035px;dialogHeight:660px;resizable:yes;')";

            //预算信息
            this.CustomerBudgetCtl.Text       = rowFormApply.CustomerBudget.ToString("N");
            this.CustomerBudgetRemainCtl.Text = rowFormApply.CustomerBudgetRemain.ToString("N");
            this.OUBudgetCtl.Text             = rowFormApply.OUBudget.ToString("N");
            this.OUApprovedAmountCtl.Text     = rowFormApply.OUAppovedAmount.ToString("N");
            this.OUApprovingAmountCtl.Text    = rowFormApply.OUApprovingAmount.ToString("N");
            this.OUCompletedAmountCtl.Text    = rowFormApply.OUCompletedAmount.ToString("N");
            this.OUReimbursedAmountCtl.Text   = rowFormApply.OUReimbursedAmount.ToString("N");
            this.OUBudgetRemainCtl.Text       = rowFormApply.OUBudgetRemain.ToString("N");
            this.OUBudgetRateCtl.Text         = ((decimal)(rowFormApply.OUBudgetRate * 100)).ToString("N") + "%";

            AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
            this.ViewState["StuffUserID"] = stuffUser.StuffUserId;

            //是否显示关闭按钮,如果没有执行完成的话那么不能关闭
            this.CloseBtn.Visible = false;
            if ((!rowFormApply.IsClose) && rowForm.StatusID == (int)SystemEnums.FormStatus.ApproveCompleted)
            {
                if (stuffUser.StuffUserId == rowForm.UserID || new MasterDataBLL().GetProxyReimburseByParameter(rowForm.UserID, stuffUser.StuffUserId, rowForm.SubmitDate).Count > 0)
                {
                    if (!rowFormApply.IsIsCompleteNull())
                    {
                        if (rowFormApply.IsComplete)
                        {
                            this.CloseBtn.Visible = true;
                        }
                    }
                }
            }

            //是否显示复制按钮
            if (rowForm.StatusID == (int)SystemEnums.FormStatus.ApproveCompleted && stuffUser.StuffUserId == rowForm.UserID)
            {
                this.UCBeginPeriod.Visible = true;
                this.UCEndPeriod.Visible   = true;
                this.lblSignal.Visible     = true;
                this.CopyBtn.Visible       = true;
            }
            else
            {
                this.UCBeginPeriod.Visible = false;
                this.UCEndPeriod.Visible   = false;
                this.lblSignal.Visible     = false;
                this.CopyBtn.Visible       = false;
            }
            //是否显示打印信息
            if (((stuffUser.StuffUserId == rowForm.UserID || base.IsBusinessProxy(rowForm.UserID, rowForm.SubmitDate) && rowForm.StatusID == (int)SystemEnums.FormStatus.ApproveCompleted) || (rowForm.StatusID == (int)SystemEnums.FormStatus.Scrap && rowFormApply.IsAutoSplit)))
            {
                this.PrintBtn.Visible = true;
            }
            else
            {
                this.PrintBtn.Visible = false;
            }

            if (rowForm.StatusID == (int)SystemEnums.FormStatus.ApproveCompleted || (rowForm.StatusID == (int)SystemEnums.FormStatus.Scrap && rowFormApply.IsAutoSplit))
            {
                this.PrintInfor.Visible = true;
                int printCount = rowFormApply.IsPrintCountNull() ? 0 : rowFormApply.PrintCount;
                this.PrintInfor.Text = "该方案已经被打印" + printCount + "次";
            }
            else
            {
                this.PrintInfor.Visible = false;
            }


            //如果是弹出,取消按钮不可见
            if (this.Request["ShowDialog"] != null)
            {
                if (this.Request["ShowDialog"].ToString() == "1")
                {
                    this.upButton.Visible   = false;
                    this.PrintInfor.Visible = false;
                    this.PrintBtn.Visible   = false;
                    this.Master.FindControl("divMenu").Visible       = false;
                    this.Master.FindControl("tbCurrentPage").Visible = false;
                }
            }
            //如果是申请人则隐藏预算信息
            if (stuffUser.StuffUserId == rowForm.UserID)
            {
                this.OUBudgetCtl.Text           = "";
                this.OUApprovedAmountCtl.Text   = "";
                this.OUApprovingAmountCtl.Text  = "";
                this.OUCompletedAmountCtl.Text  = "";
                this.OUReimbursedAmountCtl.Text = "";
                this.OUBudgetRemainCtl.Text     = "";
                this.OUBudgetRateCtl.Text       = "";
                this.btnViewBudget.Visible      = false;
            }

            //处理执行确认内容
            if (!rowFormApply.IsConfirmCompleteDateNull())
            {
                ConfirmCompleteDateCtl.Text = rowFormApply.ConfirmCompleteDate.ToString("yyyy-MM-dd");
            }
            if (!rowFormApply.IsAccruedPeriodNull())
            {
                AccruedPeriodCtl.Text = rowFormApply.AccruedPeriod.ToString("yyyy-MM");
            }
            //如果是申请人并且没有执行确认,实际费用才可以编辑
            this.ViewState["ExecuteReadOnly"] = true;
            if (!rowFormApply.IsIsCompleteNull())
            {
                if (!rowFormApply.IsComplete && rowForm.StatusID == (int)SystemEnums.FormStatus.ApproveCompleted)
                {
                    if (rowForm.UserID == stuffUser.StuffUserId || new MasterDataBLL().GetProxyReimburseByParameter(rowForm.UserID, stuffUser.StuffUserId, rowForm.SubmitDate).Count > 0)
                    {
                        this.ViewState["ExecuteReadOnly"] = false;
                        this.AccrudePeriodSignal.Visible  = true;
                        this.PeriodDDL.Visible            = true;
                        this.ExecuteConfirmBtn.Visible    = true;
                        this.ExecuteCancelBtn.Visible     = true;
                    }
                }
            }
            //分摊比例
            new FormApplySplitRateTableAdapter().FillByApplyID(InnerDS.FormApplySplitRate, formID);
            if (InnerDS.FormApplySplitRate != null && InnerDS.FormApplySplitRate.Count > 0)
            {
                this.divSplitRate.Visible   = true;
                this.gvSplitRate.Visible    = true;
                this.gvSplitRate.DataSource = InnerDS.FormApplySplitRate;
                this.gvSplitRate.DataBind();
            }
        }

        //明细信息
        FormApplyDetailViewTableAdapter taDetail = new FormApplyDetailViewTableAdapter();

        taDetail.FillByFormID(this.InnerDS.FormApplyDetailView, (int)this.ViewState["ObjectId"]);
        FormApplyExpenseDetailTableAdapter taExpense = new FormApplyExpenseDetailTableAdapter();

        taExpense.FillByFormApplyID(this.InnerDS.FormApplyExpenseDetail, (int)this.ViewState["ObjectId"]);

        this.cwfAppCheck.FormID = (int)this.ViewState["ObjectId"];
        this.cwfAppCheck.ProcID = this.ViewState["ProcID"].ToString();
    }
Пример #22
0
        public void UpdateFormMaterial(int FormID, SystemEnums.FormStatus StatusID, SystemEnums.FormType FormTypeID, int ShopID, int FirstVolume, int SecondVolume, int ThirdVolume, string Remark, string FlowTemplate)
        {
            SqlTransaction transaction = null;

            try {
                ////事务开始
                transaction = TableAdapterHelper.BeginTransaction(this.TAForm);
                TableAdapterHelper.SetTransaction(this.TAFormMaterial, transaction);
                TableAdapterHelper.SetTransaction(this.TAFormMaterialDetail, transaction);

                FormDS.FormRow formRow = this.TAForm.GetDataByID(FormID)[0];
                UtilityBLL     utility = new UtilityBLL();
                if (StatusID == SystemEnums.FormStatus.Awaiting)
                {
                    string formTypeString = utility.GetFormTypeString((int)FormTypeID);
                    formRow.FormNo            = utility.GetFormNo(formTypeString);
                    formRow.InTurnUserIds     = "P"; //待改动
                    formRow.InTurnPositionIds = "P"; //待改动
                }
                else
                {
                    formRow.SetFormNoNull();
                }
                formRow.StatusID     = (int)StatusID;
                formRow.SubmitDate   = DateTime.Now;
                formRow.LastModified = DateTime.Now;
                this.TAForm.Update(formRow);

                //处理申请表的内容
                FormDS.FormMaterialRow formMaterialRow = this.TAFormMaterial.GetDataByID(FormID)[0];
                formMaterialRow.ShopID       = ShopID;
                formMaterialRow.FirstVolume  = FirstVolume;
                formMaterialRow.SecondVolume = SecondVolume;
                formMaterialRow.ThirdVolume  = ThirdVolume;
                formMaterialRow.Remark       = Remark;
                this.TAFormMaterial.Update(formMaterialRow);

                //明细表
                decimal totalAmount = 0;//计算总申请金额
                foreach (FormDS.FormMaterialDetailRow detailRow in this.FormDataSet.FormMaterialDetail)
                {
                    // 与父表绑定
                    if (detailRow.RowState != DataRowState.Deleted)
                    {
                        detailRow.FormMaterialID = formMaterialRow.FormMaterialID;
                        totalAmount += detailRow.Amount;
                    }
                }
                this.TAFormMaterialDetail.Update(this.FormDataSet.FormMaterialDetail);

                formMaterialRow.Amount = totalAmount;
                this.TAFormMaterial.Update(formMaterialRow);
                // 正式提交或草稿
                if (StatusID == SystemEnums.FormStatus.Awaiting)
                {
                    Dictionary <string, object> dic = new Dictionary <string, object>();
                    dic["Apply_Amount"] = totalAmount;//金额
                    APHelper AP = new APHelper();
                    new APFlowBLL().ApplyForm(AP, TAForm, null, formRow, formRow.OrganizationUnitID, FlowTemplate, StatusID, dic);
                }
                transaction.Commit();
            } catch (Exception ex) {
                transaction.Rollback();
                throw new ApplicationException("Save Fail!" + ex.ToString());
            } finally {
                transaction.Dispose();
            }
        }
Пример #23
0
    protected void OpenForm(int formID)
    {
        FormDS.FormRow            rowForm            = this.PersonalReimburseBLL.GetFormByID(formID)[0];
        FormDS.FormTravelApplyRow rowFormTravelApply = this.PersonalReimburseBLL.GetFormTravelApplyByID(formID);

        if (!rowFormTravelApply.IsTransportFeeNull())
        {
            this.txtTransportFee.Text = rowFormTravelApply.TransportFee.ToString("N");
        }
        else
        {
            this.txtTransportFee.Text = "0";
        }
        if (!rowFormTravelApply.IsHotelFeeNull())
        {
            this.txtHotelFee.Text = rowFormTravelApply.HotelFee.ToString("N");
        }
        else
        {
            this.txtHotelFee.Text = "0";
        }
        if (!rowFormTravelApply.IsMealFeeNull())
        {
            this.txtMealFee.Text = rowFormTravelApply.MealFee.ToString("N");
        }
        else
        {
            this.txtMealFee.Text = "0";
        }
        if (!rowFormTravelApply.IsOtherFeeNull())
        {
            this.txtOtherFee.Text = rowFormTravelApply.OtherFee.ToString("N");
        }
        else
        {
            this.txtOtherFee.Text = "0";
        }
        if (!rowFormTravelApply.IsTotalFeeNull())
        {
            this.txtTotalAmount.Text = rowFormTravelApply.TotalFee.ToString("N");
        }
        else
        {
            this.txtOtherFee.Text = "0";
        }
        //赋值
        if (!rowFormTravelApply.IsRemarkNull())
        {
            this.RemarkCtl.Text = rowFormTravelApply.Remark;
        }
        if (!rowFormTravelApply.IsAttachedFileNameNull() && !rowFormTravelApply.IsRealAttachedFileNameNull())
        {
            this.UCFileUpload.AttachmentFileName     = rowFormTravelApply.RealAttachedFileName;
            this.UCFileUpload.RealAttachmentFileName = rowFormTravelApply.RealAttachedFileName;
        }

        // 打开明细表
        FormTravelApplyDetailTableAdapter taDetail = new FormTravelApplyDetailTableAdapter();

        taDetail.FillByApplyID(this.InnerDS.FormTravelApplyDetail, formID);
    }
Пример #24
0
        public void AddFormContract(int?RejectedFormID, int UserID, int?ProxyUserID, int?ProxyPositionID, int OrganizationUnitID, int PositionID, SystemEnums.FormType FormTypeID,
                                    SystemEnums.FormStatus StatusID, string ContractName, int ContractTypeID, Decimal?ContractAmount, int?PageNumber, string FirstCompany, string SecondCompany, string ThirdCompany, DateTime?BeginDate, DateTime?EndDate, string PaymentType, string MainContent, string ChangePart, string AttachedFileName, string RealAttachedFileName, string FlowTemplate)
        {
            SqlTransaction transaction = null;

            try {
                transaction = TableAdapterHelper.BeginTransaction(this.TAForm);
                TableAdapterHelper.SetTransaction(this.TAFormContract, transaction);

                FormDS.FormRow formRow = this.FormDataSet.Form.NewFormRow();
                if (RejectedFormID != null)
                {
                    formRow.RejectedFormID = RejectedFormID.GetValueOrDefault();
                }
                formRow.UserID = UserID;
                UtilityBLL utility = new UtilityBLL();
                if (StatusID == SystemEnums.FormStatus.Awaiting)
                {
                    string formTypeString = utility.GetFormTypeString((int)FormTypeID);
                    formRow.FormNo = utility.GetFormNo(formTypeString);
                }
                else
                {
                    formRow.SetFormNoNull();
                }
                if (ProxyUserID != null)
                {
                    formRow.ProxyUserID = ProxyUserID.GetValueOrDefault();
                }
                if (ProxyPositionID != null)
                {
                    formRow.ProxyPositionID = ProxyPositionID.GetValueOrDefault();
                }
                formRow.OrganizationUnitID = OrganizationUnitID;
                formRow.PositionID         = PositionID;
                formRow.FormTypeID         = (int)FormTypeID;
                formRow.StatusID           = (int)StatusID;
                formRow.SubmitDate         = DateTime.Now;
                formRow.LastModified       = DateTime.Now;
                formRow.InTurnUserIds      = "P"; //待改动
                formRow.InTurnPositionIds  = "P"; //待改动
                formRow.PageType           = (int)SystemEnums.PageType.ContractApply;
                this.FormDataSet.Form.AddFormRow(formRow);
                this.TAForm.Update(formRow);

                //处理申请表的内容
                FormDS.FormContractRow formContractRow = this.FormDataSet.FormContract.NewFormContractRow();
                formContractRow.ContractName         = ContractName;
                formContractRow.FormContractID       = formRow.FormID;
                formContractRow.ContractTypeID       = ContractTypeID;
                formContractRow.ContractAmount       = ContractAmount.GetValueOrDefault();
                formContractRow.PageNumber           = PageNumber.GetValueOrDefault();
                formContractRow.FirstCompany         = FirstCompany;
                formContractRow.SecondCompany        = SecondCompany;
                formContractRow.ThirdCompany         = ThirdCompany;
                formContractRow.BeginDate            = BeginDate.GetValueOrDefault();
                formContractRow.EndDate              = EndDate.GetValueOrDefault();
                formContractRow.PaymentType          = PaymentType;
                formContractRow.MainContent          = MainContent;
                formContractRow.ChangePart           = ChangePart;
                formContractRow.AttachedFileName     = AttachedFileName;
                formContractRow.RealAttachedFileName = RealAttachedFileName;
                if (StatusID == SystemEnums.FormStatus.Awaiting)
                {
                    formContractRow.ContractNo = GetContractNo(ContractTypeID);
                }
                this.FormDataSet.FormContract.AddFormContractRow(formContractRow);
                this.TAFormContract.Update(formContractRow);

                // 正式提交或草稿

                Dictionary <string, object> dic = new Dictionary <string, object>();
                dic["Apply_Amount"] = ContractAmount;    //合同金额
                dic["ContractType"] = new MasterDataBLL().GetContractTypeById(ContractTypeID).ContractTypeName;
                APHelper AP = new APHelper();
                new APFlowBLL().ApplyForm(AP, TAForm, RejectedFormID, formRow, OrganizationUnitID, FlowTemplate, StatusID, dic);

                //this.TAFormContract.Update(formContractRow);
                transaction.Commit();
            } catch (Exception ex) {
                transaction.Rollback();
                throw new ApplicationException("Save Fail!" + ex.ToString());
            } finally {
                transaction.Dispose();
            }
        }
Пример #25
0
    protected void OpenForm(int formID)
    {
        FormTableAdapter taForm = new FormTableAdapter();

        taForm.FillByID(this.InnerDS.Form, formID);
        FormDS.FormRow        rowForm     = this.InnerDS.Form[0];
        FormApplyTableAdapter taFormApply = new FormApplyTableAdapter();

        taFormApply.FillByID(this.InnerDS.FormApply, formID);
        FormDS.FormApplyRow rowFormApply = this.InnerDS.FormApply[0];
        //赋值
        this.ViewState["BeginPeriod"]          = rowFormApply.BeginPeriod.ToShortDateString();
        this.ViewState["EndPeriod"]            = rowFormApply.EndPeriod.ToShortDateString();
        this.BeginPeriodCtl.Text               = rowFormApply.BeginPeriod.ToString("yyyy-MM");
        this.EndPeriodCtl.Text                 = rowFormApply.EndPeriod.ToString("yyyy-MM");
        this.ViewState["ExpenseSubCategoryID"] = rowFormApply.ExpenseSubCategoryID.ToString();
        this.ExpenseSubCategoryCtl.Text        = new MasterDataBLL().GetExpenseSubCateNameById(rowFormApply.ExpenseSubCategoryID);
        this.ViewState["CustomerID"]           = rowFormApply.CustomerID.ToString();
        ERS.CustomerRow customer = new MasterDataBLL().GetCustomerById(rowFormApply.CustomerID);
        this.CustomerNameCtl.Text = customer.CustomerName;
        //this.CustomerTypeCtl.Text = new MasterDataBLL().GetCustomerTypeById(customer.CustomerTypeID).CustomerTypeName;
        this.odsShop.SelectParameters["CustomerID"].DefaultValue = customer.CustomerID.ToString();

        this.ViewState["PromotionPriceType"] = rowFormApply.PromotionPriceType.ToString();
        this.ShopDDL.SelectedValue           = rowFormApply.ShopID.ToString();
        this.PaymentTypeDDL.SelectedValue    = rowFormApply.PaymentTypeID.ToString();
        if (!rowFormApply.IsContractNoNull())
        {
            this.ContractNoCtl.Text = rowFormApply.ContractNo;
        }
        if (!rowFormApply.IsRemarkNull())
        {
            this.RemarkCtl.Text = rowFormApply.Remark;
        }
        if (!rowFormApply.IsAttachedFileNameNull())
        {
            this.UCFileUpload.AttachmentFileName = rowFormApply.AttachedFileName;
        }
        if (!rowFormApply.IsRealAttachedFileNameNull())
        {
            this.UCFileUpload.RealAttachmentFileName = rowFormApply.RealAttachedFileName;
        }

        if (!rowFormApply.IsPromotionBeginDateNull())
        {
            this.UCPromotionBegin.SelectedDate = rowFormApply.PromotionBeginDate.ToString("yyyy-MM-dd");
        }
        if (!rowFormApply.IsPromotionEndDateNull())
        {
            this.UCPromotionEnd.SelectedDate = rowFormApply.PromotionEndDate.ToString("yyyy-MM-dd");
        }
        if (!rowFormApply.IsDeliveryBeginDateNull())
        {
            this.UCDeliveryBegin.SelectedDate = rowFormApply.DeliveryBeginDate.ToString("yyyy-MM-dd");
        }
        if (!rowFormApply.IsDeliveryEndDateNull())
        {
            this.UCDeliveryEnd.SelectedDate = rowFormApply.DeliveryEndDate.ToString("yyyy-MM-dd");
        }
        this.PromotionScopeDDL.SelectedValue = rowFormApply.PromotionScopeID.ToString();
        this.PromotionTypeDDL.SelectedValue  = rowFormApply.PromotionTypeID.ToString();
        if (!rowFormApply.IsPromotionDescNull())
        {
            this.PromotionDescCtl.Text = rowFormApply.PromotionDesc;
        }
        this.ShelfTypeDDL.SelectedValue = rowFormApply.ShelfTypeID.ToString();
        if (!rowFormApply.IsFirstVolumeNull())
        {
            this.FirstVolumeCtl.Text = rowFormApply.FirstVolume.ToString();
        }
        if (!rowFormApply.IsSecondVolumeNull())
        {
            this.SecondVolumeCtl.Text = rowFormApply.SecondVolume.ToString();
        }
        if (!rowFormApply.IsThirdVolumeNull())
        {
            this.ThirdVolumeCtl.Text = rowFormApply.ThirdVolume.ToString();
        }
        if (!rowFormApply.IsFormApplyNameNull())
        {
            this.txtFormApplyName.Text = rowFormApply.FormApplyName;
        }
        if (!rowFormApply.IsReimburseRequirementsNull())
        {
            int ReimburseRequirement = rowFormApply.ReimburseRequirements;
            if ((ReimburseRequirement & (int)SystemEnums.ReimburseRequirements.Picture) == (int)SystemEnums.ReimburseRequirements.Picture)
            {
                chkListReimburseRequirements.Items[0].Selected = true;
            }
            if ((ReimburseRequirement & (int)SystemEnums.ReimburseRequirements.Agreement) == (int)SystemEnums.ReimburseRequirements.Agreement)
            {
                chkListReimburseRequirements.Items[1].Selected = true;
            }
            if ((ReimburseRequirement & (int)SystemEnums.ReimburseRequirements.DeliveryOrder) == (int)SystemEnums.ReimburseRequirements.DeliveryOrder)
            {
                chkListReimburseRequirements.Items[2].Selected = true;
            }
            if ((ReimburseRequirement & (int)SystemEnums.ReimburseRequirements.Contract) == (int)SystemEnums.ReimburseRequirements.Contract)
            {
                chkListReimburseRequirements.Items[3].Selected = true;
            }
            if ((ReimburseRequirement & (int)SystemEnums.ReimburseRequirements.DM) == (int)SystemEnums.ReimburseRequirements.DM)
            {
                chkListReimburseRequirements.Items[4].Selected = true;
            }
            if ((ReimburseRequirement & (int)SystemEnums.ReimburseRequirements.Other) == (int)SystemEnums.ReimburseRequirements.Other)
            {
                chkListReimburseRequirements.Items[5].Selected = true;
            }
        }
        this.ViewState["PromotionPriceType"] = rowFormApply.PromotionPriceType.ToString();
        // 打开明细表
        FormApplySKUDetailTableAdapter taSKU = new FormApplySKUDetailTableAdapter();

        taSKU.FillByFormApplyID(this.InnerDS.FormApplySKUDetail, formID);
        FormApplyExpenseDetailTableAdapter taExpense = new FormApplyExpenseDetailTableAdapter();

        taExpense.FillByFormApplyID(this.InnerDS.FormApplyExpenseDetail, formID);
        new FormApplySplitRateTableAdapter().FillByApplyID(InnerDS.FormApplySplitRate, formID);
    }
Пример #26
0
    protected void gvReimburseDetails_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        // 对数据列进行赋值
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            if ((e.Row.RowState & DataControlRowState.Edit) != DataControlRowState.Edit)
            {
                DataRowView drvDetail             = (DataRowView)e.Row.DataItem;
                FormDS.FormReimburseDetailRow row = (FormDS.FormReimburseDetailRow)drvDetail.Row;
                ApplyFeeTotal     = decimal.Round((ApplyFeeTotal + row.AccruedAmount), 2);
                RemainFeeTotal    = decimal.Round((RemainFeeTotal + row.RemainAmount), 2);
                ReimburseFeeTotal = decimal.Round((ReimburseFeeTotal + row.Amount), 2);
                PrePaidFeeTaltal  = decimal.Round(PrePaidFeeTaltal + (row.IsPrePaidAmountNull()?0:row.PrePaidAmount), 2);
                TaxFeeTotal       = decimal.Round(TaxFeeTotal + (row.IsTaxAmountNull()?0:row.TaxAmount), 2);
                HyperLink      lblApplyFormNo = (HyperLink)e.Row.FindControl("lblApplyFormNo");
                FormDS.FormRow form           = this.SalesReimburseBLL.GetFormByID(row.FormApplyID)[0];
                switch (form.PageType)
                {
                case (int)SystemEnums.PageType.PromotionApply:
                    lblApplyFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/SalesForm/SalesPromotionApproval.aspx?ShowDialog=1&ObjectId=" + row.FormApplyID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
                    break;

                case (int)SystemEnums.PageType.GeneralApply:
                    lblApplyFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/SalesForm/SalesGeneralApproval.aspx?ShowDialog=1&ObjectId=" + row.FormApplyID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
                    break;

                case (int)SystemEnums.PageType.RebateApply:
                    lblApplyFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/SalesForm/SalesRebateApproval.aspx?ShowDialog=1&ObjectId=" + row.FormApplyID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
                    break;

                case (int)SystemEnums.PageType.GeneralApplyExecute:
                    lblApplyFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/SalesForm/SalesGeneralExecution.aspx?ShowDialog=1&ObjectId=" + row.FormApplyID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
                    break;

                case (int)SystemEnums.PageType.PromotionApplyExecute:
                    lblApplyFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/SalesForm/SalesPromotionExecution.aspx?ShowDialog=1&ObjectId=" + row.FormApplyID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
                    break;
                }
            }
        }

        if (e.Row.RowType == DataControlRowType.Footer)
        {
            Label sumlbl = new Label();
            sumlbl.Text = "合计";
            e.Row.Cells[6].Controls.Add(sumlbl);
            e.Row.Cells[6].HorizontalAlign = HorizontalAlign.Center;
            e.Row.Cells[6].CssClass        = "RedTextAlignCenter";
            e.Row.Cells[6].Width           = new Unit("200px");

            Label applbl = new Label();
            applbl.Text = ApplyFeeTotal.ToString("N");
            e.Row.Cells[7].Controls.Add(applbl);
            e.Row.Cells[7].HorizontalAlign = HorizontalAlign.Right;
            e.Row.Cells[7].CssClass        = "RedTextAlignCenter";
            e.Row.Cells[7].Width           = new Unit("70px");

            Label Remainlbl = new Label();
            Remainlbl.Text = RemainFeeTotal.ToString("N");
            e.Row.Cells[8].Controls.Add(Remainlbl);
            e.Row.Cells[8].HorizontalAlign = HorizontalAlign.Right;
            e.Row.Cells[8].CssClass        = "RedTextAlignCenter";
            e.Row.Cells[8].Width           = new Unit("70px");

            Label lblPrePaidTotal = new Label();
            lblPrePaidTotal.Text = PrePaidFeeTaltal.ToString("N");
            lblPrePaidTotal.ID   = "lblPrePaidTotal";
            e.Row.Cells[9].Controls.Add(lblPrePaidTotal);
            e.Row.Cells[9].HorizontalAlign = HorizontalAlign.Right;
            e.Row.Cells[9].CssClass        = "RedTextAlignCenter";
            e.Row.Cells[9].Width           = new Unit("70px");

            Label totallbl = new Label();
            totallbl.Text = ReimburseFeeTotal.ToString("N");
            totallbl.ID   = "totallbl";
            e.Row.Cells[10].Controls.Add(totallbl);
            e.Row.Cells[10].HorizontalAlign = HorizontalAlign.Right;
            e.Row.Cells[10].CssClass        = "RedTextAlignCenter";
            e.Row.Cells[10].Width           = new Unit("70px");

            Label lblTaxTotal = new Label();
            lblTaxTotal.Text = TaxFeeTotal.ToString("N");
            lblTaxTotal.ID   = "lblTaxTotal";
            e.Row.Cells[11].Controls.Add(lblTaxTotal);
            e.Row.Cells[11].HorizontalAlign = HorizontalAlign.Right;
            e.Row.Cells[11].CssClass        = "RedTextAlignCenter";
            e.Row.Cells[11].Width           = new Unit("70px");
        }
    }
Пример #27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!this.IsPostBack)
        {
            PageUtility.SetContentTitle(this.Page, "出差审批");
            this.Page.Title = "出差审批";
            int formID = int.Parse(Request["ObjectID"]);
            this.ViewState["ObjectId"] = formID;
            QueryDS.FormViewRow       rowForm  = new FormQueryBLL().GetFormViewByID(formID);
            FormDS.FormTravelApplyRow applyRow = this.PersonalReimburseBLL.GetFormTravelApplyByID(formID);
            if (rowForm.IsProcIDNull())
            {
                ViewState["ProcID"] = "";
            }
            else
            {
                ViewState["ProcID"] = rowForm.ProcID;
            }

            ViewState["OrganizationUnitID"] = rowForm.OrganizationUnitID;
            txtFormNo.Text = rowForm.FormNo;
            AuthorizationDS.StuffUserRow applicant = new AuthorizationBLL().GetStuffUserById(rowForm.UserID);
            this.StuffNameCtl.Text    = applicant.StuffName;
            this.PositionNameCtl.Text = new OUTreeBLL().GetPositionById(rowForm.PositionID).PositionName;

            if (new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID) != null)
            {
                this.DepartmentNameCtl.Text = new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID).OrganizationUnitName;
            }

            this.AttendDateCtl.Text = applicant.AttendDate.ToShortDateString();
            if (!applyRow.IsTransportFeeNull())
            {
                this.txtTransportFee.Text = applyRow.TransportFee.ToString("N");
            }
            if (!applyRow.IsHotelFeeNull())
            {
                this.txtHotelFee.Text = applyRow.HotelFee.ToString("N");
            }
            if (!applyRow.IsMealFeeNull())
            {
                this.txtMealFee.Text = applyRow.MealFee.ToString("N");
            }
            if (!applyRow.IsOtherFeeNull())
            {
                this.txtOtherFee.Text = applyRow.OtherFee.ToString("N");
            }
            if (!applyRow.IsTotalFeeNull())
            {
                this.txtTotal.Text = applyRow.TotalFee.ToString("N");
            }
            this.RemarkCtl.Text = applyRow.Remark;
            if (!applyRow.IsAttachedFileNameNull() && !applyRow.IsRealAttachedFileNameNull())
            {
                this.UCFileUpload.AttachmentFileName     = applyRow.RealAttachedFileName;
                this.UCFileUpload.RealAttachmentFileName = applyRow.RealAttachedFileName;
            }

            // 打开明细表
            FormTravelApplyDetailTableAdapter taDetail = new FormTravelApplyDetailTableAdapter();
            taDetail.FillByApplyID(this.InnerDS.FormTravelApplyDetail, formID);

            //历史单据
            if (rowForm.IsRejectedFormIDNull())
            {
                lblRejectFormNo.Text = "无";
            }
            else
            {
                FormDS.FormRow rejectedForm = this.PersonalReimburseBLL.GetFormByID(rowForm.RejectedFormID)[0];
                this.lblRejectFormNo.Text        = rejectedForm.FormNo;
                this.lblRejectFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/OtherForm/TravelApproval.aspx?ShowDialog=1&ObjectID=" + rejectedForm.FormID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
            }

            //审批页面处理&按钮处理
            AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
            this.ViewState["StuffUserID"] = stuffUser.StuffUserId;
            if (Session["ProxyStuffUserId"] == null && rowForm.InTurnUserIds.Contains("P" + stuffUser.StuffUserId + "P"))
            {
                this.SubmitBtn.Visible   = true;
                this.cwfAppCheck.IsView  = false;
                this.ViewState["IsView"] = false;
            }
            else
            {
                this.SubmitBtn.Visible   = false;
                this.cwfAppCheck.IsView  = true;
                this.ViewState["IsView"] = true;
            }

            if (rowForm.StatusID == (int)SystemEnums.FormStatus.Rejected && (stuffUser.StuffUserId == rowForm.UserID))
            {
                this.EditBtn.Visible  = true;
                this.ScrapBtn.Visible = true;
            }
            else
            {
                this.EditBtn.Visible  = false;
                this.ScrapBtn.Visible = false;
            }

            //如果是弹出,取消按钮不可见
            if (this.Request["ShowDialog"] != null)
            {
                if (this.Request["ShowDialog"].ToString() == "1")
                {
                    this.upButton.Visible = false;
                    this.Master.FindControl("divMenu").Visible       = false;
                    this.Master.FindControl("tbCurrentPage").Visible = false;
                }
            }
        }
        this.cwfAppCheck.FormID = (int)this.ViewState["ObjectId"];
        this.cwfAppCheck.ProcID = this.ViewState["ProcID"].ToString();
        this.cwfAppCheck.IsView = (bool)this.ViewState["IsView"];
    }
Пример #28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!this.IsPostBack)
        {
            PageUtility.SetContentTitle(this.Page, "方案报销审批");
            this.Page.Title = "方案报销审批";

            int formID = int.Parse(Request["ObjectId"]);
            this.ViewState["ObjectId"] = formID;
            FormDS.FormRow          rowForm          = this.SalesReimburseBLL.GetFormByID(formID)[0];
            FormDS.FormReimburseRow rowFormReimburse = this.SalesReimburseBLL.GetFormReimburseByID(formID)[0];
            if (rowForm.IsProcIDNull())
            {
                ViewState["ProcID"] = "";
            }
            else
            {
                ViewState["ProcID"] = rowForm.ProcID;
            }

            ViewState["OrganizationUnitID"] = rowForm.OrganizationUnitID;
            this.FormNoCtl.Text             = rowForm.FormNo;
            this.ApplyDateCtl.Text          = rowForm.SubmitDate.ToShortDateString();
            AuthorizationDS.StuffUserRow applicant = new AuthorizationBLL().GetStuffUserById(rowForm.UserID);
            this.StuffNameCtl.Text    = applicant.StuffName;
            this.PositionNameCtl.Text = new OUTreeBLL().GetPositionById(rowForm.PositionID).PositionName;
            if (new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID) != null)
            {
                this.DepartmentNameCtl.Text = new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID).OrganizationUnitName;
            }
            this.AttendDateCtl.Text = applicant.AttendDate.ToShortDateString();
            MasterDataBLL   masterBll = new MasterDataBLL();
            ERS.CustomerRow customer  = masterBll.GetCustomerById(rowFormReimburse.CustomerID);
            this.CustomerNameCtl.Text = customer.CustomerName;
            this.CustomerTypeCtl.Text = masterBll.GetCustomerTypeById(customer.CustomerTypeID).CustomerTypeName;
            this.PaymentTypeCtl.Text  = masterBll.GetPaymentTypeById(rowFormReimburse.PaymentTypeID).PaymentTypeName;
            if (!rowFormReimburse.IsRemarkNull())
            {
                this.RemarkCtl.Text = rowFormReimburse.Remark;
            }
            if (!rowFormReimburse.IsAttachedFileNameNull())
            {
                this.UCFileUpload.AttachmentFileName = rowFormReimburse.AttachedFileName;
            }
            if (!rowFormReimburse.IsRealAttachedFileNameNull())
            {
                this.UCFileUpload.RealAttachmentFileName = rowFormReimburse.RealAttachedFileName;
            }

            this.odsInvoice.SelectParameters["FormReimburseID"].DefaultValue          = rowFormReimburse.FormReimburseID.ToString();
            this.odsReimburseDetails.SelectParameters["FormReimburseID"].DefaultValue = rowFormReimburse.FormReimburseID.ToString();
            //审批页面处理&按钮处理
            AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
            this.ViewState["StuffUserID"] = stuffUser.StuffUserId;
            if (rowForm.InTurnUserIds.Contains("P" + stuffUser.StuffUserId + "P"))
            {
                this.SubmitBtn.Visible   = true;
                this.cwfAppCheck.IsView  = false;
                this.ViewState["IsView"] = false;
            }
            else
            {
                this.SubmitBtn.Visible   = false;
                this.cwfAppCheck.IsView  = true;
                this.ViewState["IsView"] = true;
            }

            if (rowForm.StatusID == (int)SystemEnums.FormStatus.Rejected && stuffUser.StuffUserId == rowForm.UserID)
            {
                this.EditBtn.Visible  = true;
                this.ScrapBtn.Visible = true;
            }
            else
            {
                this.EditBtn.Visible  = false;
                this.ScrapBtn.Visible = false;
            }

            if (!rowFormReimburse.IsPaymentDateNull())
            {
                this.txtPaymentDate.Text        = rowFormReimburse.PaymentDate.ToString("yyyy-MM-dd");
                this.ucPaymentDate.SelectedDate = rowFormReimburse.PaymentDate.ToString("yyyy-MM-dd");
            }


            AuthorizationDS.PositionRow position         = (AuthorizationDS.PositionRow) this.Session["Position"];
            PositionRightBLL            positionRightBLL = new PositionRightBLL();
            if (rowForm.StatusID == (int)SystemEnums.FormStatus.ApproveCompleted && positionRightBLL.CheckPositionRight(position.PositionId, (int)SystemEnums.OperateEnum.Other + (int)SystemEnums.BusinessUseCase.FormReimburse))
            {
                this.txtPaymentDate.Visible     = false;
                this.ucPaymentDate.Visible      = true;
                this.btnSavePaymentInfo.Visible = true;
            }

            //历史单据
            if (rowForm.IsRejectedFormIDNull())
            {
                lblRejectFormNo.Text = "无";
            }
            else
            {
                FormDS.FormRow rejectedForm = this.SalesReimburseBLL.GetFormByID(rowForm.RejectedFormID)[0];
                this.lblRejectFormNo.Text        = rejectedForm.FormNo;
                this.lblRejectFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/SalesForm/ReimburseMoneyApproval.aspx?ShowDialog=1&ObjectId=" + rejectedForm.FormID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
            }

            //如果是弹出,取消按钮不可见
            if (this.Request["ShowDialog"] != null)
            {
                if (this.Request["ShowDialog"].ToString() == "1")
                {
                    this.upButton.Visible = false;
                    this.Master.FindControl("divMenu").Visible       = false;
                    this.Master.FindControl("tbCurrentPage").Visible = false;
                }
            }
        }

        this.cwfAppCheck.FormID = (int)this.ViewState["ObjectId"];
        this.cwfAppCheck.ProcID = this.ViewState["ProcID"].ToString();
        this.cwfAppCheck.IsView = (bool)this.ViewState["IsView"];
    }
Пример #29
0
        //审批方法
        public void ApproveForm(APHelper AP, int formID, int stuffUserId, string stuffName, bool pass, string comment, string ProxyStuffName, int OrganizationUnitID)
        {
            string         email       = string.Empty;
            SqlTransaction transaction = null;

            try {
                FormTableAdapter TAMainForm = new FormTableAdapter();

                transaction = TableAdapterHelper.BeginTransaction(TAMainForm);

                FormDS.FormRow formRow = TAMainForm.GetDataByID(formID)[0];

                string   returnValue = AP.approve(pass, comment, stuffUserId.ToString(), stuffName, formRow.ProcID, ProxyStuffName, formRow.OrganizationUnitID, ref email);
                string[] approveinfo = AP.GetProcessApproveUser(formRow.ProcID);
                if (AP.GetProcessIsEnd(formRow.ProcID))
                {
                    formRow.LastApprover = stuffUserId.ToString();
                    formRow.Comment      = comment;
                    formRow.ApprovedDate = Convert.ToDateTime(approveinfo[0]);
                }
                formRow.ApproverIds = approveinfo[3];
                if (returnValue == null)
                {
                    formRow.InTurnUserIds     = "P";
                    formRow.InTurnPositionIds = "P";
                    //formRow.SubmitDate = DateTime.Now;

                    if (pass)
                    {
                        //如果审批通过且返回值为空则该流程结束

                        formRow.StatusID = (int)SystemEnums.FormStatus.ApproveCompleted;
                        //mailTitle = string.Format("您申请的编号为{0}的单据已经通过审批", formRow.FormNo);
                        //mailBody = string.Format(mailBody, formRow.FormNo);
                        //email = AP.getUserEmailByID(formRow.UserID);

                        //AP.sendMail(email, "", mailTitle, mailBody);
                    }
                    else
                    {
                        //如果不通过则为驳回
                        formRow.StatusID = (int)SystemEnums.FormStatus.Rejected;

                        //mailTitle = string.Format("您有单据申请被{0}退回", stuffName);
                        //mailBody = string.Format(mailBody, formRow.FormNo);
                        //email = AP.getUserEmailByID(formRow.UserID);

                        //AP.sendMail(email, "", mailTitle, mailBody);
                    }
                }
                else
                {
                    string[] InTurn = returnValue.Split('&');//不同流程角色下的人员和职位
                    string   ids    = "";
                    string   pids   = "";
                    for (int a = 0; a < InTurn.Length; a++)
                    {
                        ids  += InTurn[a].Split('$')[0].ToString(); ///人员
                        pids += InTurn[a].Split('$')[1].ToString(); //职位
                    }
                    formRow.InTurnUserIds     = ids;                //下一步的人员
                    formRow.InTurnPositionIds = pids;               //下一步的人员职位

                    //mailTitle = string.Format(mailTitle, stuffName, formRow.FormNo);
                    //mailBody = string.Format(mailBody, formRow.FormNo);
                    //AP.sendMail(email, "", mailTitle,mailBody);
                }

                TAMainForm.Update(formRow);

                transaction.Commit();
            } catch (Exception ex) {
                if (transaction != null)
                {
                    transaction.Rollback();
                }
                throw ex;
            } finally {
                if (transaction != null)
                {
                    transaction.Dispose();
                }
            }
            //System.Threading.Thread.Sleep(3000);
        }
Пример #30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!this.IsPostBack)
        {
            PageUtility.SetContentTitle(this.Page, "出差费用报销审批");
            this.Page.Title = "出差费用报销审批";

            int formID = int.Parse(Request["ObjectId"]);
            this.ViewState["ObjectId"] = formID;

            FormDS.FormRow rowForm = this.PersonalReimburseBLL.GetFormByID(formID)[0];
            FormDS.FormPersonalReimburseRow rowPersonalReimburse = this.PersonalReimburseBLL.GetFormPersonalReimburseByID(formID)[0];
            if (rowForm.IsProcIDNull())
            {
                ViewState["ProcID"] = "";
            }
            else
            {
                ViewState["ProcID"] = rowForm.ProcID;
            }

            ViewState["OrganizationUnitID"] = rowForm.OrganizationUnitID;
            //对控件进行赋值
            this.txtFormNo.Text    = rowForm.FormNo;
            this.ApplyDateCtl.Text = rowForm.SubmitDate.ToShortDateString();
            AuthorizationDS.StuffUserRow applicant = new AuthorizationBLL().GetStuffUserById(rowForm.UserID);
            this.StuffNameCtl.Text    = applicant.StuffName;
            this.PositionNameCtl.Text = new OUTreeBLL().GetPositionById(rowForm.PositionID).PositionName;
            if (new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID) != null)
            {
                this.DepartmentNameCtl.Text = new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID).OrganizationUnitName;
            }
            this.AttendDateCtl.Text = applicant.AttendDate.ToShortDateString();
            this.txtPeriod.Text     = rowPersonalReimburse.Period.ToString("yyyyMM");
            if (!rowPersonalReimburse.IsRemarkNull())
            {
                this.RemarkCtl.Text = rowPersonalReimburse.Remark;
            }

            //出差申请信息
            FormDS.FormTravelApplyRow rowTravelApply = this.PersonalReimburseBLL.GetFormTravelApplyByID(rowPersonalReimburse.FormTravelApplyID);
            if (!rowTravelApply.IsTransportFeeNull())
            {
                this.txtTransportFee.Text = rowTravelApply.TransportFee.ToString("N");
            }
            if (!rowTravelApply.IsHotelFeeNull())
            {
                this.txtHotelFee.Text = rowTravelApply.HotelFee.ToString("N");
            }
            if (!rowTravelApply.IsMealFeeNull())
            {
                this.txtMealFee.Text = rowTravelApply.MealFee.ToString("N");
            }
            if (!rowTravelApply.IsOtherFeeNull())
            {
                this.txtOtherFee.Text = rowTravelApply.OtherFee.ToString("N");
            }
            if (!rowTravelApply.IsTotalFeeNull())
            {
                this.txtTotal.Text = rowTravelApply.TotalFee.ToString("N");
            }
            //赋值
            if (!rowTravelApply.IsRemarkNull())
            {
                this.RemarkCtl.Text = rowTravelApply.Remark;
            }

            FormDS.FormRow rowApplyForm = PersonalReimburseBLL.GetFormByID(rowTravelApply.FormTravelApplyID)[0];
            hlTravelApply.Text             = rowApplyForm.FormNo;
            this.hlTravelApply.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/OtherForm/TravelApproval.aspx?ShowDialog=1&ObjectId=" + rowApplyForm.FormID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";

            //历史单据
            if (rowForm.IsRejectedFormIDNull())
            {
                lblRejectFormNo.Text = "无";
            }
            else
            {
                FormDS.FormRow rejectedForm = new ContractApplyBLL().GetFormByID(rowForm.RejectedFormID)[0];
                this.lblRejectFormNo.Text        = rejectedForm.FormNo;
                this.lblRejectFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/OtherForm/PersonalReimburseApproval.aspx?ShowDialog=1&ObjectId=" + rejectedForm.FormID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
            }

            //审批页面处理&按钮处理&预算信息
            this.txtTotalBudget.Text     = rowPersonalReimburse.TotalBudget.ToString("N");
            this.txtApprovingAmount.Text = rowPersonalReimburse.ApprovingAmount.ToString("N");
            this.txtApprovedAmount.Text  = rowPersonalReimburse.ApprovedAmount.ToString("N");
            this.txtRemainAmount.Text    = rowPersonalReimburse.RemainAmount.ToString("N");

            AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
            this.ViewState["StuffUserID"] = stuffUser.StuffUserId;
            if (rowForm.InTurnUserIds.Contains("P" + stuffUser.StuffUserId + "P"))
            {
                this.SubmitBtn.Visible   = true;
                this.cwfAppCheck.IsView  = false;
                this.ViewState["IsView"] = false;
            }
            else
            {
                this.SubmitBtn.Visible   = false;
                this.cwfAppCheck.IsView  = true;
                this.ViewState["IsView"] = true;
            }

            if (rowForm.StatusID == (int)SystemEnums.FormStatus.Rejected && stuffUser.StuffUserId == rowForm.UserID)
            {
                this.EditBtn.Visible  = true;
                this.ScrapBtn.Visible = true;
            }
            else
            {
                this.EditBtn.Visible  = false;
                this.ScrapBtn.Visible = false;
            }

            if (rowForm.UserID == stuffUser.StuffUserId)
            {
                this.BudgetTitleDIV.Visible = false;
                this.BudgetInfoDIV.Visible  = false;
            }
            //如果是弹出,取消按钮不可见
            if (this.Request["ShowDialog"] != null)
            {
                if (this.Request["ShowDialog"].ToString() == "1")
                {
                    this.upButton.Visible = false;
                    this.Master.FindControl("divMenu").Visible       = false;
                    this.Master.FindControl("tbCurrentPage").Visible = false;
                }
            }

            //保存实报金额按钮
            int opSaveId = BusinessUtility.GetBusinessOperateId(SystemEnums.BusinessUseCase.FormPersonalReimburse, SystemEnums.OperateEnum.Other);
            AuthorizationDS.PositionRow position = (AuthorizationDS.PositionRow) this.Session["Position"];
            if (new PositionRightBLL().CheckPositionRight(position.PositionId, opSaveId) && (rowForm.StatusID == 1 || rowForm.StatusID == 2))
            {
                HasSaveRight = true;
            }
            else
            {
                HasSaveRight = false;
            }
            if (HasSaveRight)
            {
                this.SaveBtn.Visible = true;
            }
            else
            {
                this.SaveBtn.Visible = false;
            }
            //超预算提示
            if (rowPersonalReimburse.Amount > rowTravelApply.TotalFee)
            {
                this.imgOverBudget.Visible = true;
            }

            // 打开明细表
            new FormPersonalReimburseDetailTableAdapter().FillByFormID(InnerDS.FormPersonalReimburseDetail, rowForm.FormID);
            this.gvTravelReimburseDetails.DataSource = new FormPersonalReimburseDetailTableAdapter().GetDataByFormID(rowForm.FormID);
            this.gvTravelReimburseDetails.DataBind();
            this.gvFormTravelApplyDetails.DataSource = new FormTravelApplyDetailTableAdapter().GetDataByApplyID(rowTravelApply.FormTravelApplyID);
            this.gvFormTravelApplyDetails.DataBind();
        }
        this.cwfAppCheck.FormID = (int)this.ViewState["ObjectId"];
        this.cwfAppCheck.ProcID = this.ViewState["ProcID"].ToString();
        this.cwfAppCheck.IsView = (bool)this.ViewState["IsView"];
    }