protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!this.IsPostBack) {
            String title = this.GetLocalResourceObject("titleLabel.Text").ToString();
            PageUtility.SetContentTitle(this.Page, title);

            MasterDataBLL mdBLL = new MasterDataBLL();
            int formID = int.Parse(Request["ObjectId"]);
            this.ViewState["ObjectId"] = formID;
            FormDS.FormSalePaymentRow rowFormPayment = this.FormSaleBLL.GetFormSalePaymentByID(int.Parse(this.ViewState["ObjectId"].ToString()));

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

            this.FormNoCtl.Text = rowForm.FormNo;
            AuthorizationDS.StuffUserRow applicant = new AuthorizationBLL().GetStuffUserById(rowForm.UserID);
            this.StuffNameCtl.Text = CommonUtility.GetStaffFullName(applicant);
            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.StuffNoCtl.Text = applicant.IsStuffNoNull() ? "" : applicant.StuffNo;
            this.AttendDateCtl.Text = applicant.AttendDate.ToShortDateString();

            this.ApplyFormNoCtl.Text = this.FormSaleBLL.GetFormByID(rowFormPayment.FormSaleApplyID)[0].FormNo;
            FormDS.FormSaleApplyRow rowFormApply = this.FormSaleBLL.GetFormSaleApplyByID(rowFormPayment.FormSaleApplyID)[0];
            this.PeriodCtl.Text = rowFormApply.FPeriod.ToString("yyyy-MM");

            MasterData.CustomerRow customer = mdBLL.GetCustomerById(rowFormApply.CustomerID)[0];
            this.CustomerNameCtl.Text = customer.CustomerName;
            this.CustomerChannelCtl.Text = mdBLL.GetCustomerChannelById(customer.CustomerChannelID)[0].CustomerChannelName;
            this.KATypeCtl.Text = customer.IsKaTypeNull() ? "" : customer.KaType;
            this.CustomerRegionCtl.Text = mdBLL.GetCustomerRegionById(customer.CustomerRegionID).CustomerRegionName;
            this.CityCtl.Text = customer.City;
            this.BrandCtl.Text = mdBLL.GetBrandById(rowFormApply.BrandID)[0].BrandName;
            MasterData.ExpenseSubCategoryRow rowExpenseSubCategory = mdBLL.GetExpenseSubCategoryById(rowFormApply.ExpenseSubCategoryID);
            this.ExpenseCategoryCtl.Text = mdBLL.GetExpenseCategoryById(rowExpenseSubCategory.ExpenseCategoryID).ExpenseCategoryName;
            this.ExpenseSubCategoryCtl.Text = rowExpenseSubCategory.ExpenseSubCategoryName;
            this.CurrencyCtl.Text = mdBLL.GetCurrencyByID(rowFormApply.CurrencyID).CurrencyShortName;
            this.ExchangeRateCtl.Text = rowFormApply.ExchangeRate.ToString();
            this.ShopNameCtl.Text = rowFormApply.IsShopNameNull() ? "" : rowFormApply.ShopName;
            this.ShopCountCtl.Text = rowFormApply.IsShopCountNull() ? "" : rowFormApply.ShopCount.ToString();
            this.ProjectNameCtl.Text = rowFormApply.IsProjectNameNull() ? "" : rowFormApply.ProjectName;
            this.CostCenterCtl.Text = CommonUtility.GetMAACostCenterFullName(rowForm.CostCenterID);
            if (!rowFormApply.IsActivityBeginDateNull()) {
                this.ActivityBeginCtl.Text = rowFormApply.ActivityBeginDate.ToString("yyyy-MM-dd");
            }
            if (!rowFormApply.IsActivityEndDateNull()) {
                this.ActivityEndCtl.Text = rowFormApply.ActivityEndDate.ToString("yyyy-MM-dd");
            }
            this.ProjectDescCtl.Text = rowFormApply.IsProjectDescNull() ? "" : rowFormApply.ProjectDesc;
            if (!rowFormApply.IsApplyFileNameNull())
                this.UCFileUpload.AttachmentFileName = rowFormApply.ApplyFileName;
            if (!rowFormApply.IsApplyRealFileNameNull())
                this.UCFileUpload.RealAttachmentFileName = rowFormApply.ApplyRealFileName;

            if (!rowFormPayment.IsRemarkNull()) {
                this.RemarkCtl.Text = rowFormPayment.Remark;
            }
            if (!rowFormPayment.IsAttachedFileNameNull()) {
                this.UCPaymentFile.AttachmentFileName = rowFormPayment.AttachedFileName;
            }
            if (!rowFormPayment.IsRealAttachedFileNameNull()) {
                this.UCPaymentFile.RealAttachmentFileName = rowFormPayment.RealAttachedFileName;
            }
            this.InvoiceStatusCtl.Text = new InvoiceStatusTableAdapter().GetDataByID(rowFormPayment.InvoiceStatusID)[0].Name;
            if (!rowFormPayment.IsVendorIDNull()) {
                MasterData.VendorRow vendor = mdBLL.GetVendorByID(rowFormPayment.VendorID);
                this.VendorCtl.Text = vendor.VendorName + "-" + vendor.VendorCode;
            }

            this.txtVatType.Text = mdBLL.GetVatTypeById(rowFormPayment.VatTypeID)[0].VatTypeName;
            //PO
            if (!rowFormPayment.IsFormPOIDNull()) {
                FormDS.FormRow rowFormPO = this.FormSaleBLL.GetFormByID(rowFormPayment.FormPOID)[0];
                this.hlPO.Text = rowFormPO.FormNo;
                this.hlPO.NavigateUrl = CommonUtility.GetPOPostBackUrl(rowFormPO.FormID);
            } else {
                this.hlPO.Text = "无";
            }
            //历史单据
            if (rowForm.IsRejectedFormIDNull()) {
                lblRejectFormNo.Text = "无";
            } else {
                FormDS.FormRow rejectedForm = this.FormSaleBLL.GetFormByID(rowForm.RejectedFormID)[0];
                this.lblRejectFormNo.Text = rejectedForm.FormNo;
                this.lblRejectFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/FormSale/NoActivityAdvancedPaymentApproval.aspx?ShowDialog=1&ObjectId=" + rejectedForm.FormID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
            }

            //明细
            this.odsInvoice.SelectParameters["FormID"].DefaultValue = rowFormPayment.FormSalePaymentID.ToString();
            this.odsPaymentDetails.SelectParameters["FormSalePaymentID"].DefaultValue = rowFormPayment.FormSalePaymentID.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 (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 (!rowForm.IsFinanceRemarkNull()) {
                this.FinanceRemarkCtl.Text = rowForm.FinanceRemark;
            }
            int opViewId = BusinessUtility.GetBusinessOperateId(SystemEnums.BusinessUseCase.FinanceRemark, SystemEnums.OperateEnum.View);
            int opManageId = BusinessUtility.GetBusinessOperateId(SystemEnums.BusinessUseCase.FinanceRemark, SystemEnums.OperateEnum.Manage);
            AuthorizationDS.PositionRow ViewerPosition = (AuthorizationDS.PositionRow)this.Session["Position"];
            PositionRightBLL positionRightBLL = new PositionRightBLL();
            bool HasViewRight = positionRightBLL.CheckPositionRight(ViewerPosition.PositionId, opViewId);
            bool HasManageRight = positionRightBLL.CheckPositionRight(ViewerPosition.PositionId, opManageId);
            //如果没有权限则隐藏
            if (!HasViewRight && !HasManageRight) {
                this.FinanceRemarkTitleDIV.Visible = false;
                this.FinanceRemarkDIV.Visible = false;
                this.SaveBtn.Visible = false;
            }
            //如果没有填写的权限或者已经填写了,则隐藏保存按钮
            if (HasViewRight && (!HasManageRight || !rowForm.IsFinanceRemarkNull())) {
                this.FinanceRemarkCtl.ReadOnly = true;
                this.SaveBtn.Visible = false;
            }
            //如果不是审批中或者审批完成不能修改
            if (rowForm.StatusID != 1 && rowForm.StatusID != 2) {
                this.FinanceRemarkCtl.ReadOnly = true;
                this.SaveBtn.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) {
            String title = this.GetLocalResourceObject("titleLabel.Text").ToString();
            PageUtility.SetContentTitle(this.Page, title);

            MasterDataBLL mdBLL = new MasterDataBLL();
            int formID = int.Parse(Request["ObjectId"]);
            this.ViewState["ObjectId"] = formID;
            FormDS.FormSalePaymentRow rowFormPayment = this.FormSaleBLL.GetFormSalePaymentByID(int.Parse(this.ViewState["ObjectId"].ToString()));

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

            this.FormNoCtl.Text = rowForm.FormNo;
            AuthorizationDS.StuffUserRow applicant = new AuthorizationBLL().GetStuffUserById(rowForm.UserID);
            this.StuffNameCtl.Text = CommonUtility.GetStaffFullName(applicant);
            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();

            FormDS.FormSaleSettlementRow rowFormSettlement = this.FormSaleBLL.GetFormSaleSettlementByID(rowFormPayment.FormSaleSettlementID);
            FormDS.FormRow settlementForm = this.FormSaleBLL.GetFormByID(rowFormPayment.FormSaleSettlementID)[0];

            MasterData.CustomerRow customer = mdBLL.GetCustomerById(rowFormSettlement.CustomerID)[0];
            this.CustomerNameCtl.Text = customer.CustomerName;
            this.CustomerChannelCtl.Text = mdBLL.GetCustomerChannelById(customer.CustomerChannelID)[0].CustomerChannelName;
            this.CustomerRegionCtl.Text = mdBLL.GetCustomerRegionById(customer.CustomerRegionID).CustomerRegionName;
            this.CityCtl.Text = customer.City;
            this.BrandCtl.Text = mdBLL.GetBrandById(rowFormSettlement.BrandID)[0].BrandName;
            MasterData.ExpenseSubCategoryRow rowExpenseSubCategory = mdBLL.GetExpenseSubCategoryById(rowFormSettlement.ExpenseSubCategoryID);
            this.ExpenseCategoryCtl.Text = mdBLL.GetExpenseCategoryById(rowExpenseSubCategory.ExpenseCategoryID).ExpenseCategoryName;
            this.ExpenseSubCategoryCtl.Text = rowExpenseSubCategory.ExpenseSubCategoryName;
            this.CurrencyCtl.Text = mdBLL.GetCurrencyByID(rowFormSettlement.CurrencyID).CurrencyShortName;
            this.CostCenterCtl.Text = CommonUtility.GetMAACostCenterFullName(rowForm.CostCenterID);

            this.SettlementRemarkCtl.Text = rowFormSettlement.IsRemarkNull() ? "" : rowFormSettlement.Remark;
            if (!rowFormSettlement.IsAttachedFileNameNull())
                this.UCSettlementFile.AttachmentFileName = rowFormSettlement.AttachedFileName;
            if (!rowFormSettlement.IsRealAttachedFileNameNull())
                this.UCSettlementFile.RealAttachmentFileName = rowFormSettlement.RealAttachedFileName;

            if (!rowFormPayment.IsRemarkNull()) {
                this.RemarkCtl.Text = rowFormPayment.Remark;
            }
            if (!rowFormPayment.IsAttachedFileNameNull()) {
                this.UCPaymentFile.AttachmentFileName = rowFormPayment.AttachedFileName;
            }
            if (!rowFormPayment.IsRealAttachedFileNameNull()) {
                this.UCPaymentFile.RealAttachmentFileName = rowFormPayment.RealAttachedFileName;
            }
            this.PaymentTypeCtl.Text = new MasterDataBLL().GetPaymentTypeById(rowFormPayment.PaymentTypeID).PaymentTypeName;
            if (!rowFormPayment.IsVendorIDNull()) {
                MasterData.VendorRow vendor = new MasterDataBLL().GetVendorByID(rowFormPayment.VendorID);
                this.VendorCtl.Text = vendor.VendorName + "-" + vendor.VendorCode;
            }

            this.SettlementFormNoCtl.Text = settlementForm.FormNo;
            this.SettlementFormNoCtl.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/FormSale/SettlementApproval.aspx?ShowDialog=1&ObjectId=" + rowFormPayment.FormSaleSettlementID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";

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

            //费用合计信息
            ApplyAmountRMBCtl.Text = rowFormSettlement.IsApplyAmountRMBNull() ? "" : rowFormSettlement.ApplyAmountRMB.ToString();
            ForecastOrderAmountCtl.Text = rowFormSettlement.IsForecastOrderAmountNull() ? "" : rowFormSettlement.ForecastOrderAmount.ToString();
            CostBenefitRateCtl.Text = rowFormSettlement.IsCostBenefitRateNull() ? "" : rowFormSettlement.CostBenefitRate.ToString();
            AmountRMBCtl.Text = rowFormSettlement.AmountRMB.ToString();
            ActualOrderAmountCtl.Text = rowFormSettlement.IsActualOrderAmountNull() ? "" : rowFormSettlement.ActualOrderAmount.ToString();
            ActualCostBenefitRateCtl.Text = rowFormSettlement.IsActualCostBenefitRateNull() ? "" : rowFormSettlement.ActualCostBenefitRate.ToString();

            //判断是Activity还是NoActivity,如果NoActivity那么需要隐藏
            if (settlementForm.PageType == (int)SystemEnums.PageType.NoActivitySettlementApply) {
                this.FeeSumTR.Visible = false;
                this.SKUDiv.Visible = false;
                this.gvSKUDetails.Visible = false;
            }

            //明细
            this.odsFreeGoods.SelectParameters["FormSalePaymentID"].DefaultValue = rowFormPayment.FormSalePaymentID.ToString();
            this.odsSKUDetails.SelectParameters["FormSaleSettlementID"].DefaultValue = rowFormPayment.FormSaleSettlementID.ToString();
            this.odsPaymentDetails.SelectParameters["FormSalePaymentID"].DefaultValue = rowFormPayment.FormSalePaymentID.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 (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.ucPrint.FormID = rowForm.FormID;

            FormDS.FormDeliveryGoodsDataTable tbDelivery= new FormSaleBLL().GetFormDeliveryGoodByFormID(formID);
            if (tbDelivery.Count > 0) {
                this.gvDeliveryInfo.DataSource = tbDelivery;
                this.gvDeliveryInfo.DataBind();
            } else {
                this.divDeliveryInfo.Visible = false;
                this.gvDeliveryInfo.Visible = false;
            }

            //发货完成按钮权限
            int opManageId = BusinessUtility.GetBusinessOperateId(SystemEnums.BusinessUseCase.DeliveryComplete, SystemEnums.OperateEnum.Other);
            AuthorizationDS.PositionRow position = (AuthorizationDS.PositionRow)this.Session["Position"];
            PositionRightBLL positionRightBLL = new PositionRightBLL();
            if (positionRightBLL.CheckPositionRight(position.PositionId, opManageId) && (rowFormPayment.IsIsDeliveryCompleteNull() || rowFormPayment.IsDeliveryComplete == false)) {
                this.DeliveryCompleteBtn.Visible = false;
            }
        }
        this.cwfAppCheck.FormID = (int)this.ViewState["ObjectId"];
        this.cwfAppCheck.ProcID = this.ViewState["ProcID"].ToString();
        this.cwfAppCheck.IsView = (bool)this.ViewState["IsView"];
    }
예제 #3
0
    protected void OpenForm(int formID)
    {
        FormDS.FormRow rowForm = this.FormSaleBLL.GetFormByID(formID)[0];
        FormDS.FormSaleApplyRow rowFormApply = this.FormSaleBLL.GetFormSaleApplyByID(formID)[0];
        MasterDataBLL MasterDataBLL = new MasterDataBLL();
        //赋值
        this.ViewState["FPeriod"] = rowFormApply.FPeriod.ToShortDateString();
        this.PeriodCtl.Text = rowFormApply.FPeriod.ToString("yyyy-MM");
        this.ViewState["CustomerID"] = rowFormApply.CustomerID.ToString();
        this.ViewState["BrandID"] = rowFormApply.BrandID.ToString();
        this.ViewState["ExpenseSubCategoryID"] = rowFormApply.ExpenseSubCategoryID.ToString();
        this.ViewState["CurrencyID"] = rowFormApply.CurrencyID.ToString();

        MasterData.CustomerRow customer = MasterDataBLL.GetCustomerById(rowFormApply.CustomerID)[0];
        this.txtCustomerCode.Text = customer.CustomerNo;
        this.CustomerNameCtl.Text = customer.CustomerName;
        this.ViewState["CustomerChannelID"] = customer.CustomerChannelID.ToString();
        this.CustomerChannelCtl.Text = MasterDataBLL.GetCustomerChannelById(customer.CustomerChannelID)[0].CustomerChannelName;
        this.KATypeCtl.Text = customer.IsKaTypeNull() ? "" : customer.KaType;
        this.CustomerRegionCtl.Text = MasterDataBLL.GetCustomerRegionById(customer.CustomerRegionID).CustomerRegionName;
        this.CityCtl.Text = customer.City;
        this.BrandCtl.Text = MasterDataBLL.GetBrandById(rowFormApply.BrandID)[0].BrandName;
        MasterData.ExpenseSubCategoryRow rowExpenseSubCategory = MasterDataBLL.GetExpenseSubCategoryById(rowFormApply.ExpenseSubCategoryID);
        this.ExpenseCategoryCtl.Text = MasterDataBLL.GetExpenseCategoryById(rowExpenseSubCategory.ExpenseCategoryID).ExpenseCategoryName;
        this.ExpenseSubCategoryCtl.Text = rowExpenseSubCategory.ExpenseSubCategoryName;
        this.CurrencyCtl.Text = new CurrencyTableAdapter().GetDataByID(rowFormApply.CurrencyID)[0].CurrencyShortName;

        this.ShopNameCtl.Text = rowFormApply.IsShopNameNull() ? "" : rowFormApply.ShopName;
        this.ShopCountCtl.Text = rowFormApply.IsShopCountNull() ? "" : rowFormApply.ShopCount.ToString();
        this.ProjectNameCtl.Text = rowFormApply.IsProjectNameNull() ? "" : rowFormApply.ProjectName;
        if (!rowForm.IsCostCenterIDNull()) {
            this.CostCenterDDL.SelectedValue = rowForm.CostCenterID.ToString();
        }
        this.ProjectDescCtl.Text = rowFormApply.IsProjectDescNull() ? "" : rowFormApply.ProjectDesc;
        if (!rowFormApply.IsApplyFileNameNull())
            this.UCFileUpload.AttachmentFileName = rowFormApply.ApplyFileName;
        if (!rowFormApply.IsApplyRealFileNameNull())
            this.UCFileUpload.RealAttachmentFileName = rowFormApply.ApplyRealFileName;
        //促销信息
        this.DisplayTypeDDL.SelectedValue = rowFormApply.DisplayTypeID.ToString();
        this.DisplayAreaCtl.Text = rowFormApply.IsDisplayAreaNull() ? "" : rowFormApply.DisplayArea.ToString();
        this.DMDDL.SelectedValue = rowFormApply.IsDM ? "1" : "0";
        this.DiscountTypeDDL.SelectedValue = rowFormApply.DiscountTypeID.ToString();

        if (!rowFormApply.IsActivityBeginDateNull()) {
            this.UCActivityBegin.SelectedDate = rowFormApply.ActivityBeginDate.ToString("yyyy-MM-dd");
        }
        if (!rowFormApply.IsActivityEndDateNull()) {
            this.UCActivityEnd.SelectedDate = rowFormApply.ActivityEndDate.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");
        }

        // 打开明细表
        FormSaleSKUDetailTableAdapter taSKUDetail = new FormSaleSKUDetailTableAdapter();
        taSKUDetail.FillByFormSaleApplyID(this.InnerDS.FormSaleSKUDetail, formID);
        FormSaleExpenseDetailTableAdapter taExpenseDetail = new FormSaleExpenseDetailTableAdapter();
        taExpenseDetail.FillByFormSaleApplyID(this.InnerDS.FormSaleExpenseDetail, formID);
        //如果打开的是有pricediscount的单据,应该在明细中先删除,然后再保存时再添加

        for (int index = 0; index < this.InnerDS.FormSaleExpenseDetail.Count; index++) {
            MasterData.ExpenseItemRow expenseItem = new MasterDataBLL().GetExpenseItemById(this.InnerDS.FormSaleExpenseDetail[index].ExpenseItemID);
            if (expenseItem.IsPriceDiscount) {
                this.InnerDS.FormSaleExpenseDetail.Rows[index].Delete();
            }
        }
    }
예제 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!this.IsPostBack) {
            String title = this.GetLocalResourceObject("titleLabel.Text").ToString();
            PageUtility.SetContentTitle(this.Page, title);

            // 用户信息,职位信息
            AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
            AuthorizationDS.PositionRow rowUserPosition = (AuthorizationDS.PositionRow)Session["Position"];
            this.ViewState["StuffUserID"] = stuffUser.StuffUserId;
            this.ViewState["PositionID"] = rowUserPosition.PositionId;

            this.StuffNameCtl.Text = CommonUtility.GetStaffFullName(stuffUser);
            this.PositionNameCtl.Text = rowUserPosition.PositionName;
            this.DepartmentNameCtl.Text = new OUTreeBLL().GetOrganizationUnitById(rowUserPosition.OrganizationUnitId).OrganizationUnitName;
            this.ViewState["DepartmentID"] = rowUserPosition.OrganizationUnitId;
            this.StuffNoCtl.Text = stuffUser.IsStuffNoNull() ? "" : stuffUser.StuffNo;
            this.AttendDateCtl.Text = stuffUser.AttendDate.ToShortDateString();

            if (this.Request["RejectObjectID"] != null) {
                this.ViewState["RejectedObjectID"] = int.Parse(this.Request["RejectObjectID"].ToString());
            }
            //如果是草稿进行赋值
            MasterDataBLL MasterDataBLL = new MasterDataBLL();
            if (Request["ObjectId"] != null) {
                this.ViewState["ObjectId"] = int.Parse(Request["ObjectId"]);
                if (this.Request["RejectObjectID"] == null) {
                    this.DeleteBtn.Visible = true;
                } else {
                    this.DeleteBtn.Visible = false;
                }
                OpenForm(int.Parse(this.ViewState["ObjectId"].ToString()));
            } else {
                this.DeleteBtn.Visible = false;
                if (Request["PeriodSaleID"] != null) {
                    DateTime FPeriod = MasterDataBLL.GetPeriodSaleById(int.Parse(Request["PeriodSaleID"].ToString())).PeriodSale;
                    this.ViewState["FPeriod"] = new MasterDataBLL().GetPeriodSaleById(int.Parse(Request["PeriodSaleID"].ToString())).PeriodSale.ToShortDateString();
                } else {
                    this.Session["ErrorInfor"] = "没有费用期间,请联系管理员";
                    Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
                }
                if (Request["CustomerID"] != null) {
                    this.ViewState["CustomerID"] = Request["CustomerID"];
                } else {
                    this.Session["ErrorInfor"] = "未找到客户,请联系管理员";
                    Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
                }
                if (Request["BrandID"] != null) {
                    this.ViewState["BrandID"] = Request["BrandID"];
                } else {
                    this.Session["ErrorInfor"] = "未找到Brand,请联系管理员";
                    Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
                }
                if (Request["ExpenseSubCategoryID"] != null) {
                    this.ViewState["ExpenseSubCategoryID"] = Request["ExpenseSubCategoryID"];
                } else {
                    this.Session["ErrorInfor"] = "未找到费用小类,请联系管理员";
                    Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
                }
                if (Request["CurrencyID"] != null) {
                    this.ViewState["CurrencyID"] = Request["CurrencyID"];
                } else {
                    this.Session["ErrorInfor"] = "未找到币种,请联系管理员";
                    Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
                }

                this.PeriodCtl.Text = DateTime.Parse(this.ViewState["FPeriod"].ToString()).ToString("yyyy-MM");

                MasterData.CustomerRow customer = MasterDataBLL.GetCustomerById(int.Parse(this.ViewState["CustomerID"].ToString()))[0];
                this.txtCustomerCode.Text = customer.CustomerNo;
                this.CustomerNameCtl.Text = customer.CustomerName;
                ViewState["CustomerChannelID"] = customer.CustomerChannelID.ToString();
                this.CustomerChannelCtl.Text = MasterDataBLL.GetCustomerChannelById(customer.CustomerChannelID)[0].CustomerChannelName;
                this.KATypeCtl.Text = customer.IsKaTypeNull() ? "" : customer.KaType;
                this.CustomerRegionCtl.Text = MasterDataBLL.GetCustomerRegionById(customer.CustomerRegionID).CustomerRegionName;
                this.CityCtl.Text = customer.City;
                this.BrandCtl.Text = MasterDataBLL.GetBrandById(int.Parse(this.ViewState["BrandID"].ToString()))[0].BrandName;
                MasterData.ExpenseSubCategoryRow rowExpenseSubCategory = MasterDataBLL.GetExpenseSubCategoryById(int.Parse(this.ViewState["ExpenseSubCategoryID"].ToString()));
                this.ExpenseCategoryCtl.Text = MasterDataBLL.GetExpenseCategoryById(rowExpenseSubCategory.ExpenseCategoryID).ExpenseCategoryName;
                this.ExpenseSubCategoryCtl.Text = rowExpenseSubCategory.ExpenseSubCategoryName;
                this.CurrencyCtl.Text = new CurrencyTableAdapter().GetDataByID(int.Parse(this.ViewState["CurrencyID"].ToString()))[0].CurrencyShortName;

            }
            this.ExpenseSubCategoryID.Value = this.ViewState["ExpenseSubCategoryID"].ToString();
            this.BrandID.Value = this.ViewState["BrandID"].ToString();
            this.ViewState["ExchangeRate"] = new MasterDataBLL().GetExchangeRateByPeriod(int.Parse(ViewState["CurrencyID"].ToString()), DateTime.Parse(ViewState["FPeriod"].ToString()));
            if (decimal.Parse(this.ViewState["ExchangeRate"].ToString()) == 0) {
                this.Session["ErrorInfor"] = "未找到汇率,请联系管理员";
                Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
            }
            this.ExchangeRateCtl.Text = this.ViewState["ExchangeRate"].ToString();

            //判断费用期间是否正确
            MasterDataBLL bll = new MasterDataBLL();
            if (!new MasterDataBLL().IsValidPeriodSale(DateTime.Parse(this.ViewState["FPeriod"].ToString()))) {
                this.SubmitBtn.Visible = false;
                PageUtility.ShowModelDlg(this, "不允许申请本月项目,请删除草稿并联系财务部!");
                return;
            }

            //预算信息
            this.ViewState["ExpenseCategoryID"] = new MasterDataBLL().GetExpenseSubCategoryById(int.Parse(this.ViewState["ExpenseSubCategoryID"].ToString())).ExpenseCategoryID.ToString();
            decimal[] calculateAssistant = new decimal[6];
            calculateAssistant = new BudgetBLL().GetSalesBudgetByParameter(rowUserPosition.PositionId, DateTime.Parse(ViewState["FPeriod"].ToString()), int.Parse(this.ViewState["ExpenseCategoryID"].ToString()), int.Parse(ViewState["CustomerChannelID"].ToString()), int.Parse(this.ViewState["BrandID"].ToString()));
            this.TotalBudgetCtl.Text = calculateAssistant[0].ToString("N");
            this.ApprovedAmountCtl.Text = calculateAssistant[1].ToString("N");
            this.ApprovingAmountCtl.Text = calculateAssistant[2].ToString("N");
            this.CompletedAmountCtl.Text = calculateAssistant[3].ToString("N");
            this.ReimbursedAmountCtl.Text = calculateAssistant[4].ToString("N");
            this.RemainBudgetCtl.Text = calculateAssistant[5].ToString("N");

        }
        //查看预算权限
        int opViewId = BusinessUtility.GetBusinessOperateId(SystemEnums.BusinessUseCase.ViewBudget, SystemEnums.OperateEnum.Manage);
        AuthorizationDS.PositionRow position = (AuthorizationDS.PositionRow)this.Session["Position"];
        bool HasManageRight = new PositionRightBLL().CheckPositionRight(position.PositionId, opViewId);
        this.divBudgetInfo.Visible = HasManageRight;
        this.divBudgetInfoTitle.Visible = HasManageRight;
    }
예제 #5
0
    protected void OpenForm(int formID)
    {
        FormDS.FormRow rowForm = this.FormSaleBLL.GetFormByID(formID)[0];
        FormDS.FormSaleApplyRow rowFormApply = this.FormSaleBLL.GetFormSaleApplyByID(formID)[0];
        MasterDataBLL MasterDataBLL = new MasterDataBLL();
        //赋值
        this.ViewState["FPeriod"] = rowFormApply.FPeriod.ToShortDateString();
        this.PeriodCtl.Text = rowFormApply.FPeriod.ToString("yyyy-MM");
        this.ViewState["CustomerID"] = rowFormApply.CustomerID.ToString();
        this.ViewState["BrandID"] = rowFormApply.BrandID.ToString();
        this.ViewState["ExpenseSubCategoryID"] = rowFormApply.ExpenseSubCategoryID.ToString();
        this.ViewState["CurrencyID"] = rowFormApply.CurrencyID.ToString();

        MasterData.CustomerRow customer = MasterDataBLL.GetCustomerById(rowFormApply.CustomerID)[0];
        this.txtCustomerNo.Text = customer.CustomerNo;
        this.CustomerNameCtl.Text = customer.CustomerName;
        this.ViewState["CustomerChannelID"] = customer.CustomerChannelID.ToString();
        this.CustomerChannelCtl.Text = MasterDataBLL.GetCustomerChannelById(customer.CustomerChannelID)[0].CustomerChannelName;
        this.KATypeCtl.Text = customer.IsKaTypeNull() ? "" : customer.KaType;
        this.CustomerRegionCtl.Text = MasterDataBLL.GetCustomerRegionById(customer.CustomerRegionID).CustomerRegionName;
        this.CityCtl.Text = customer.City;
        this.BrandCtl.Text = MasterDataBLL.GetBrandById(rowFormApply.BrandID)[0].BrandName;
        MasterData.ExpenseSubCategoryRow rowExpenseSubCategory = MasterDataBLL.GetExpenseSubCategoryById(rowFormApply.ExpenseSubCategoryID);
        this.ExpenseCategoryCtl.Text = MasterDataBLL.GetExpenseCategoryById(rowExpenseSubCategory.ExpenseCategoryID).ExpenseCategoryName;
        this.ExpenseSubCategoryCtl.Text = rowExpenseSubCategory.ExpenseSubCategoryName;
        this.CurrencyCtl.Text = new CurrencyTableAdapter().GetDataByID(rowFormApply.CurrencyID)[0].CurrencyShortName;

        this.ShopNameCtl.Text = rowFormApply.IsShopNameNull() ? "" : rowFormApply.ShopName;
        this.ShopCountCtl.Text = rowFormApply.IsShopCountNull() ? "" : rowFormApply.ShopCount.ToString();
        this.ProjectNameCtl.Text = rowFormApply.IsProjectNameNull() ? "" : rowFormApply.ProjectName;
        if (!rowForm.IsCostCenterIDNull()) {
            this.CostCenterDDL.SelectedValue = rowForm.CostCenterID.ToString();
        }
        if (!rowFormApply.IsActivityBeginDateNull()) {
            this.UCActivityBegin.SelectedDate = rowFormApply.ActivityBeginDate.ToString("yyyy-MM-dd");
        }
        if (!rowFormApply.IsActivityEndDateNull()) {
            this.UCActivityEnd.SelectedDate = rowFormApply.ActivityEndDate.ToString("yyyy-MM-dd");
        }
        this.ProjectDescCtl.Text = rowFormApply.IsProjectDescNull() ? "" : rowFormApply.ProjectDesc;
        if (!rowFormApply.IsApplyFileNameNull())
            this.UCFileUpload.AttachmentFileName = rowFormApply.ApplyFileName;
        if (!rowFormApply.IsApplyRealFileNameNull())
            this.UCFileUpload.RealAttachmentFileName = rowFormApply.ApplyRealFileName;

        // 打开明细表
        new FormSaleExpenseDetailTableAdapter().FillByFormSaleApplyID(this.InnerDS.FormSaleExpenseDetail, formID);
    }
예제 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!this.IsPostBack) {
            String title = this.GetLocalResourceObject("titleLabel.Text").ToString();
            PageUtility.SetContentTitle(this.Page, title);

            // 用户信息,职位信息
            AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
            AuthorizationDS.PositionRow rowUserPosition = (AuthorizationDS.PositionRow)Session["Position"];
            this.ViewState["StuffUserID"] = stuffUser.StuffUserId;
            this.ViewState["PositionID"] = rowUserPosition.PositionId;

            this.StuffNameCtl.Text = CommonUtility.GetStaffFullName(stuffUser);
            this.PositionNameCtl.Text = rowUserPosition.PositionName;
            this.DepartmentNameCtl.Text = new OUTreeBLL().GetOrganizationUnitById(rowUserPosition.OrganizationUnitId).OrganizationUnitName;
            this.ViewState["DepartmentID"] = rowUserPosition.OrganizationUnitId;
            this.AttendDateCtl.Text = stuffUser.AttendDate.ToShortDateString();
            this.StuffNoCtl.Text = stuffUser.IsStuffNoNull() ? "" : stuffUser.StuffNo;
            if (this.Request["RejectObjectID"] != null) {
                this.ViewState["RejectedObjectID"] = int.Parse(this.Request["RejectObjectID"].ToString());
            }
            //如果是草稿进行赋值
            if (Request["ObjectId"] != null) {
                this.ViewState["ObjectId"] = int.Parse(Request["ObjectId"]);
                if (this.Request["RejectObjectID"] == null) {
                    this.DeleteBtn.Visible = true;
                } else {
                    this.DeleteBtn.Visible = false;
                }
                FormDS.FormRow rowForm = this.FormSaleBLL.GetFormByID(int.Parse(this.ViewState["ObjectId"].ToString()))[0];
                FormDS.FormSaleSettlementRow rowFormSettlement = this.FormSaleBLL.GetFormSaleSettlementByID(int.Parse(this.ViewState["ObjectId"].ToString()));
                //赋值
                this.ViewState["CustomerID"] = rowFormSettlement.CustomerID.ToString();
                this.ViewState["BrandID"] = rowFormSettlement.BrandID.ToString();
                this.ViewState["ExpenseSubCategoryID"] = rowFormSettlement.ExpenseSubCategoryID.ToString();
                this.ViewState["CurrencyID"] = rowFormSettlement.CurrencyID.ToString();
                this.ViewState["FormApplyNos"] = rowFormSettlement.FormApplyNos;
                this.ViewState["FormApplyIds"] = rowFormSettlement.FormApplyIds;
                this.ViewState["CostCenterID"] = rowForm.CostCenterID.ToString();

                if (!rowFormSettlement.IsRemarkNull()) {
                    this.RemarkCtl.Text = rowFormSettlement.Remark;
                }
                if (!rowFormSettlement.IsAttachedFileNameNull()) {
                    this.UCSettlementFile.AttachmentFileName = rowFormSettlement.AttachedFileName;
                }
                if (!rowFormSettlement.IsRealAttachedFileNameNull()) {
                    this.UCSettlementFile.RealAttachmentFileName = rowFormSettlement.RealAttachedFileName;
                }
                this.PaymentTypeDDL.SelectedValue = rowFormSettlement.PaymentTypeID.ToString();
                //处理明细
                new FormSettlementSKUDetailTableAdapter().FillByFormSaleSettlementID(this.InnerDS.FormSettlementSKUDetail, rowFormSettlement.FormSaleSettlementID);
                new FormSettlementExpenseDetailTableAdapter().FillCurrentDataByFormSaleSettlementID(this.InnerDS.FormSettlementExpenseDetail, rowFormSettlement.FormSaleSettlementID);
            } else {
                this.DeleteBtn.Visible = false;
                if (Request["FormApplyIds"] != null) {
                    this.ViewState["FormApplyIds"] = Request["FormApplyIds"];
                } else {
                    this.Session["ErrorInfor"] = "没有选择申请单,请联系管理员";
                    Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
                }
                if (Request["CustomerID"] != null) {
                    this.ViewState["CustomerID"] = Request["CustomerID"];
                } else {
                    this.Session["ErrorInfor"] = "未找到客户,请联系管理员";
                    Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
                }
                if (Request["BrandID"] != null) {
                    this.ViewState["BrandID"] = Request["BrandID"];
                } else {
                    this.Session["ErrorInfor"] = "未找到Brand,请联系管理员";
                    Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
                }
                if (Request["ExpenseSubCategoryID"] != null) {
                    this.ViewState["ExpenseSubCategoryID"] = Request["ExpenseSubCategoryID"];
                } else {
                    this.Session["ErrorInfor"] = "未找到费用小类,请联系管理员";
                    Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
                }
                if (Request["CurrencyID"] != null) {
                    this.ViewState["CurrencyID"] = Request["CurrencyID"];
                } else {
                    this.Session["ErrorInfor"] = "未找到币种,请联系管理员";
                    Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
                }
                if (Request["CostCenterID"] != null) {
                    this.ViewState["CostCenterID"] = Request["CostCenterID"];
                } else {
                    this.Session["ErrorInfor"] = "未找到成本中心,请联系管理员";
                    Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
                }
                if (Request["FormApplyNos"] != null) {
                    this.ViewState["FormApplyNos"] = Request["FormApplyNos"];
                } else {
                    this.Session["ErrorInfor"] = "没有选择申请单,请联系管理员";
                    Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
                }
                //处理明细
                new FormSettlementSKUDetailTableAdapter().FillByApplyIds(this.InnerDS.FormSettlementSKUDetail, this.ViewState["FormApplyIds"].ToString());
                new FormSettlementExpenseDetailTableAdapter().FillByApplyIds(this.InnerDS.FormSettlementExpenseDetail, this.ViewState["FormApplyIds"].ToString());
            }
            MasterDataBLL mdBLL = new MasterDataBLL();
            MasterData.CustomerRow customer = mdBLL.GetCustomerById(int.Parse(this.ViewState["CustomerID"].ToString()))[0];
            this.CustomerNameCtl.Text = customer.CustomerName;
            ViewState["CustomerChannelID"] = customer.CustomerChannelID.ToString();
            this.CustomerChannelCtl.Text = mdBLL.GetCustomerChannelById(customer.CustomerChannelID)[0].CustomerChannelName;
            this.CustomerRegionCtl.Text = mdBLL.GetCustomerRegionById(customer.CustomerRegionID).CustomerRegionName;
            this.KATypeCtl.Text = customer.IsKaTypeNull() ? "" : customer.KaType;
            this.CityCtl.Text = customer.City;
            this.BrandCtl.Text = mdBLL.GetBrandById(int.Parse(this.ViewState["BrandID"].ToString()))[0].BrandName;
            MasterData.ExpenseSubCategoryRow rowExpenseSubCategory = mdBLL.GetExpenseSubCategoryById(int.Parse(this.ViewState["ExpenseSubCategoryID"].ToString()));
            this.ExpenseCategoryCtl.Text = mdBLL.GetExpenseCategoryById(rowExpenseSubCategory.ExpenseCategoryID).ExpenseCategoryName;
            this.ExpenseSubCategoryCtl.Text = rowExpenseSubCategory.ExpenseSubCategoryName;
            this.CurrencyCtl.Text = new CurrencyTableAdapter().GetDataByID(int.Parse(this.ViewState["CurrencyID"].ToString()))[0].CurrencyShortName;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!this.IsPostBack) {
            String title = this.GetLocalResourceObject("titleLabel.Text").ToString();
            PageUtility.SetContentTitle(this.Page, title);

            // 用户信息,职位信息
            AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
            AuthorizationDS.PositionRow rowUserPosition = (AuthorizationDS.PositionRow)Session["Position"];
            this.ViewState["StuffUserID"] = stuffUser.StuffUserId;
            this.ViewState["PositionID"] = rowUserPosition.PositionId;

            this.StuffNameCtl.Text = CommonUtility.GetStaffFullName(stuffUser);
            this.PositionNameCtl.Text = rowUserPosition.PositionName;
            this.DepartmentNameCtl.Text = new OUTreeBLL().GetOrganizationUnitById(rowUserPosition.OrganizationUnitId).OrganizationUnitName;
            this.ViewState["DepartmentID"] = rowUserPosition.OrganizationUnitId;
            this.StuffNoCtl.Text = stuffUser.IsStuffNoNull() ? "" : stuffUser.StuffNo;
            this.AttendDateCtl.Text = stuffUser.AttendDate.ToShortDateString();

            if (this.Request["RejectObjectID"] != null) {
                this.ViewState["RejectedObjectID"] = int.Parse(this.Request["RejectObjectID"].ToString());
            }

            //如果是草稿进行赋值
            int formApplyID;
            if (Request["ObjectId"] != null) {
                this.ViewState["ObjectId"] = int.Parse(Request["ObjectId"]);
                FormDS.FormSalePaymentRow rowFormPayment = this.FormSaleBLL.GetFormSalePaymentByID(int.Parse(this.ViewState["ObjectId"].ToString()));
                formApplyID = rowFormPayment.FormSaleApplyID;
                this.ViewState["FormSaleApplyID"] = formApplyID;
                if (this.Request["RejectObjectID"] == null) {
                    this.DeleteBtn.Visible = true;
                } else {
                    this.DeleteBtn.Visible = false;
                }
                //赋值备注等
                this.InvoiceStatusDDL.SelectedValue = rowFormPayment.InvoiceStatusID.ToString();
                if (!rowFormPayment.IsRemarkNull()) {
                    this.RemarkCtl.Text = rowFormPayment.Remark;
                }
                if (!rowFormPayment.IsAttachedFileNameNull()) {
                    this.UCPaymentFile.AttachmentFileName = rowFormPayment.AttachedFileName;
                }
                if (!rowFormPayment.IsRealAttachedFileNameNull()) {
                    this.UCPaymentFile.RealAttachmentFileName = rowFormPayment.RealAttachedFileName;
                }
                if (!rowFormPayment.IsVendorIDNull()) {
                    this.UCVendor.VendorID = rowFormPayment.VendorID.ToString();
                }
                if (!rowFormPayment.IsFormPOIDNull()) {
                    this.UCPO.FormID = rowFormPayment.FormPOID.ToString();
                }
                if (!rowFormPayment.IsVatTypeIDNull()) {
                    this.VATTypeDDL.SelectedValue = rowFormPayment.VatTypeID.ToString();
                }

                new FormSalePaymentDetailTableAdapter().FillCurrentDataForAdvanced(this.InnerDS.FormSalePaymentDetail, rowFormPayment.FormSalePaymentID, rowFormPayment.FormSaleApplyID);
                new FormInvoiceTableAdapter().FillByFormID(this.InnerDS.FormInvoice, rowFormPayment.FormSalePaymentID);
            } else {
                this.DeleteBtn.Visible = false;
                formApplyID = int.Parse(Request["FormSaleApplyID"]);
                this.ViewState["FormSaleApplyID"] = formApplyID;
                new FormSalePaymentDetailTableAdapter().FillByFormSaleApplyID(this.InnerDS.FormSalePaymentDetail, formApplyID);
            }

            MasterDataBLL mdBLL = new MasterDataBLL();
            this.FormNoCtl.Text = this.FormSaleBLL.GetFormByID(formApplyID)[0].FormNo;
            FormDS.FormSaleApplyRow rowFormApply = this.FormSaleBLL.GetFormSaleApplyByID(formApplyID)[0];
            this.PeriodCtl.Text = rowFormApply.FPeriod.ToString("yyyy-MM");

            MasterData.CustomerRow customer = mdBLL.GetCustomerById(rowFormApply.CustomerID)[0];
            this.CustomerNameCtl.Text = customer.CustomerName;
            this.CustomerChannelCtl.Text = mdBLL.GetCustomerChannelById(customer.CustomerChannelID)[0].CustomerChannelName;
            this.KATypeCtl.Text = customer.IsKaTypeNull() ? "" : customer.KaType;
            this.CustomerRegionCtl.Text = mdBLL.GetCustomerRegionById(customer.CustomerRegionID).CustomerRegionName;
            this.CityCtl.Text = customer.City;
            this.BrandCtl.Text = mdBLL.GetBrandById(rowFormApply.BrandID)[0].BrandName;
            MasterData.ExpenseSubCategoryRow rowExpenseSubCategory = mdBLL.GetExpenseSubCategoryById(rowFormApply.ExpenseSubCategoryID);
            MasterData.ExpenseCategoryRow rowExpenseCategory = mdBLL.GetExpenseCategoryById(rowExpenseSubCategory.ExpenseCategoryID);
            this.ExpenseCategoryCtl.Text = rowExpenseCategory.ExpenseCategoryName;
            this.ExpenseSubCategoryCtl.Text = rowExpenseSubCategory.ExpenseSubCategoryName;
            this.ViewState["NeedPO"] = rowExpenseCategory.NeedPO;
            this.CurrencyCtl.Text = mdBLL.GetCurrencyByID(rowFormApply.CurrencyID).CurrencyShortName;
            this.ExchangeRateCtl.Text = rowFormApply.ExchangeRate.ToString();
            this.ShopNameCtl.Text = rowFormApply.IsShopNameNull() ? "" : rowFormApply.ShopName;
            this.ShopCountCtl.Text = rowFormApply.IsShopCountNull() ? "" : rowFormApply.ShopCount.ToString();
            this.ProjectNameCtl.Text = rowFormApply.IsProjectNameNull() ? "" : rowFormApply.ProjectName;
            this.ViewState["CostCenterID"] = this.FormSaleBLL.GetFormByID(formApplyID)[0].CostCenterID;
            this.CostCenterCtl.Text = CommonUtility.GetMAACostCenterFullName(int.Parse(this.ViewState["CostCenterID"].ToString()));

            this.ProjectDescCtl.Text = rowFormApply.IsProjectDescNull() ? "" : rowFormApply.ProjectDesc;
            if (!rowFormApply.IsApplyFileNameNull())
                this.UCFileUpload.AttachmentFileName = rowFormApply.ApplyFileName;
            if (!rowFormApply.IsApplyRealFileNameNull())
                this.UCFileUpload.RealAttachmentFileName = rowFormApply.ApplyRealFileName;

            if (!rowFormApply.IsActivityBeginDateNull()) {
                this.ActivityBeginCtl.Text = rowFormApply.ActivityBeginDate.ToString("yyyy-MM-dd");
            }
            if (!rowFormApply.IsActivityEndDateNull()) {
                this.ActivityEndCtl.Text = rowFormApply.ActivityEndDate.ToString("yyyy-MM-dd");
            }
        }
    }
예제 #8
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");
            }
            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;
            }
            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;
                }
            }

            //��ʷ����
            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: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") + "%";

            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 (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"];
    }
예제 #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!this.IsPostBack) {
            String title = this.GetLocalResourceObject("titleLabel.Text").ToString();
            PageUtility.SetContentTitle(this.Page, title);

            MasterDataBLL mdBLL = new MasterDataBLL();
            int formID = int.Parse(Request["ObjectId"]);
            this.ViewState["ObjectId"] = formID;
            FormDS.FormRow rowForm = this.FormSaleBLL.GetFormByID(formID)[0];
            FormDS.FormSaleApplyRow rowFormApply = this.FormSaleBLL.GetFormSaleApplyByID(formID)[0];
            if (rowForm.IsProcIDNull()) {
                ViewState["ProcID"] = "";
            } else {
                ViewState["ProcID"] = rowForm.ProcID;
            }

            this.FormNoCtl.Text = rowForm.FormNo;
            AuthorizationDS.StuffUserRow applicant = new AuthorizationBLL().GetStuffUserById(rowForm.UserID);
            this.StuffNameCtl.Text = CommonUtility.GetStaffFullName(applicant);
            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.StuffNoCtl.Text = applicant.IsStuffNoNull() ? "" : applicant.StuffNo;
            this.AttendDateCtl.Text = applicant.AttendDate.ToShortDateString();

            this.PeriodCtl.Text = rowFormApply.FPeriod.ToString("yyyy-MM");

            MasterData.CustomerRow customer = mdBLL.GetCustomerById(rowFormApply.CustomerID)[0];
            this.txtCustomerNo.Text = customer.CustomerNo;
            this.CustomerNameCtl.Text = customer.CustomerName;
            this.CustomerChannelCtl.Text = mdBLL.GetCustomerChannelById(customer.CustomerChannelID)[0].CustomerChannelName;
            this.KATypeCtl.Text = customer.IsKaTypeNull() ? "" : customer.KaType;
            this.CustomerRegionCtl.Text = mdBLL.GetCustomerRegionById(customer.CustomerRegionID).CustomerRegionName;
            this.CityCtl.Text = customer.City;
            this.BrandCtl.Text = mdBLL.GetBrandById(rowFormApply.BrandID)[0].BrandName;
            MasterData.ExpenseSubCategoryRow rowExpenseSubCategory = mdBLL.GetExpenseSubCategoryById(rowFormApply.ExpenseSubCategoryID);
            this.ExpenseCategoryCtl.Text = mdBLL.GetExpenseCategoryById(rowExpenseSubCategory.ExpenseCategoryID).ExpenseCategoryName;
            this.ExpenseSubCategoryCtl.Text = rowExpenseSubCategory.ExpenseSubCategoryName;
            this.CurrencyCtl.Text = mdBLL.GetCurrencyByID(rowFormApply.CurrencyID).CurrencyShortName;
            this.ExchangeRateCtl.Text = rowFormApply.ExchangeRate.ToString();
            this.ShopNameCtl.Text = rowFormApply.IsShopNameNull() ? "" : rowFormApply.ShopName;
            this.ShopCountCtl.Text = rowFormApply.IsShopCountNull() ? "" : rowFormApply.ShopCount.ToString();
            this.ProjectNameCtl.Text = rowFormApply.IsProjectNameNull() ? "" : rowFormApply.ProjectName;
            this.CostCenterCtl.Text = CommonUtility.GetMAACostCenterFullName(rowForm.CostCenterID);
            //历史单据
            if (rowForm.IsRejectedFormIDNull()) {
                lblRejectFormNo.Text = "无";
            } else {
                FormDS.FormRow rejectedForm = this.FormSaleBLL.GetFormByID(rowForm.RejectedFormID)[0];
                this.lblRejectFormNo.Text = rejectedForm.FormNo;
                this.lblRejectFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/FormSale/ActivityApproval.aspx?ShowDialog=1&ObjectId=" + rejectedForm.FormID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
            }
            //结案单编号
            int SaleSettlementID = this.FormSaleBLL.GetValidSaleSettlementIDBySaleApplyID(formID);
            if (SaleSettlementID == 0) {
                this.hlSettlementFormNo.Text = "未结案";
            } else {
                FormDS.FormRow settledForm = this.FormSaleBLL.GetFormByID(SaleSettlementID)[0];
                this.hlSettlementFormNo.Text = settledForm.FormNo;
                this.hlSettlementFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/FormSale/SettlementApproval.aspx?ShowDialog=1&ObjectId=" + settledForm.FormID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
            }

            this.ProjectDescCtl.Text = rowFormApply.IsProjectDescNull() ? "" : rowFormApply.ProjectDesc;
            if (!rowFormApply.IsApplyFileNameNull())
                this.UCFileUpload.AttachmentFileName = rowFormApply.ApplyFileName;
            if (!rowFormApply.IsApplyRealFileNameNull())
                this.UCFileUpload.RealAttachmentFileName = rowFormApply.ApplyRealFileName;
            //促销信息
            this.DisplayTypeCtl.Text = mdBLL.GetDisplayTypeById(rowFormApply.DisplayTypeID).DisplayTypeName;
            this.DisplayAreaCtl.Text = rowFormApply.IsDisplayAreaNull() ? "" : rowFormApply.DisplayArea.ToString();
            this.IsDMCtl.Text = rowFormApply.IsDM ? "Yes" : "No";
            this.DiscountTypeCtl.Text = mdBLL.GetDiscountTypeById(rowFormApply.DiscountTypeID).DiscountTypeName;

            if (!rowFormApply.IsActivityBeginDateNull()) {
                this.ActivityBeginCtl.Text = rowFormApply.ActivityBeginDate.ToString("yyyy-MM-dd");
            }
            if (!rowFormApply.IsActivityEndDateNull()) {
                this.ActivityEndCtl.Text = rowFormApply.ActivityEndDate.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");
            }

            this.TotalBudgetCtl.Text = rowFormApply.TotalBudget.ToString("N");
            this.ApprovedAmountCtl.Text = rowFormApply.ApprovedAmount.ToString("N");
            this.ApprovingAmountCtl.Text = rowFormApply.ApprovingAmount.ToString("N");
            this.CompletedAmountCtl.Text = rowFormApply.CompletedAmount.ToString("N");
            this.ReimbursedAmountCtl.Text = rowFormApply.ReimbursedAmount.ToString("N");
            this.RemainBudgetCtl.Text = rowFormApply.RemainBudget.ToString("N");

            //明细
            this.odsSKUDetails.SelectParameters["FormSaleApplyID"].DefaultValue = rowFormApply.FormSaleApplyID.ToString();
            this.odsExpenseDetails.SelectParameters["FormSaleApplyID"].DefaultValue = rowFormApply.FormSaleApplyID.ToString();
            //费用统计信息
            if (!rowFormApply.IsPriceDiscountAmountRMBNull()) {
                this.PriceDiscountAmountRMBCtl.Text = rowFormApply.PriceDiscountAmountRMB.ToString("N");
            }
            if (!rowFormApply.IsOtherAmountRMBNull()) {
                this.OtherAmountRMBCtl.Text = rowFormApply.OtherAmountRMB.ToString("N");
            }
            this.AmountRMBCtl.Text = rowFormApply.AmountRMB.ToString("N");
            if (!rowFormApply.IsForecastOrderAmountNull()) {
                this.ForecastOrderAmountCtl.Text = rowFormApply.ForecastOrderAmount.ToString("N");
            }
            if (!rowFormApply.IsCostBenefitRateNull()) {
                this.CostBenefitRateCtl.Text = rowFormApply.CostBenefitRate.ToString("N");
            }
            this.odsExpenseSummary.SelectParameters["FormSaleApplyID"].DefaultValue = rowFormApply.FormSaleApplyID.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 (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 (rowForm.StatusID == (int)SystemEnums.FormStatus.ApproveCompleted) {
                this.IsVisible = "";
            } else {
                this.IsVisible = "none";
            }
        }
        //查看预算权限
        int opViewId = BusinessUtility.GetBusinessOperateId(SystemEnums.BusinessUseCase.ViewBudget, SystemEnums.OperateEnum.Manage);
        AuthorizationDS.PositionRow position = (AuthorizationDS.PositionRow)this.Session["Position"];
        bool HasManageRight = new PositionRightBLL().CheckPositionRight(position.PositionId, opViewId);
        this.divBudgetInfo.Visible = HasManageRight;
        this.divBudgetInfoTitle.Visible = HasManageRight;
        //流程控件赋值
        this.cwfAppCheck.FormID = (int)this.ViewState["ObjectId"];
        this.cwfAppCheck.ProcID = this.ViewState["ProcID"].ToString();
        this.cwfAppCheck.IsView = (bool)this.ViewState["IsView"];
    }
예제 #10
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];
            //�������û��������ɵĻ����Dz���¼����߲鿴������Ϣ��
            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"];
    }
예제 #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!this.IsPostBack) {
            String title = this.GetLocalResourceObject("titleLabel.Text").ToString();
            PageUtility.SetContentTitle(this.Page, title);

            // 用户信息,职位信息
            AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
            AuthorizationDS.PositionRow rowUserPosition = (AuthorizationDS.PositionRow)Session["Position"];
            this.ViewState["StuffUserID"] = stuffUser.StuffUserId;
            this.ViewState["PositionID"] = rowUserPosition.PositionId;

            this.StuffNameCtl.Text = CommonUtility.GetStaffFullName(stuffUser);
            this.PositionNameCtl.Text = rowUserPosition.PositionName;
            this.DepartmentNameCtl.Text = new OUTreeBLL().GetOrganizationUnitById(rowUserPosition.OrganizationUnitId).OrganizationUnitName;
            this.ViewState["DepartmentID"] = rowUserPosition.OrganizationUnitId;
            this.AttendDateCtl.Text = stuffUser.AttendDate.ToShortDateString();

            if (this.Request["RejectObjectID"] != null) {
                this.ViewState["RejectedObjectID"] = int.Parse(this.Request["RejectObjectID"].ToString());
            }
            MasterDataBLL mdBLL = new MasterDataBLL();
            //赋值备注等
            this.PaymentTypeDDL.DataSource = mdBLL.GetPaymentTypeForDDL();
            this.PaymentTypeDDL.DataTextField = "PaymentTypeName";
            this.PaymentTypeDDL.DataValueField = "PaymentTypeID";
            this.PaymentTypeDDL.DataBind();
            this.VATTypeDDL.DataBind();
            PaymentTypeDDL_SelectedIndexChanged(null, null);
            //如果是草稿进行赋值
            int FormSaleSettlementID;
            if (Request["ObjectId"] != null) {
                this.ViewState["ObjectId"] = int.Parse(Request["ObjectId"]);
                FormDS.FormSalePaymentRow rowFormPayment = this.FormSaleBLL.GetFormSalePaymentByID(int.Parse(this.ViewState["ObjectId"].ToString()));
                FormSaleSettlementID = rowFormPayment.FormSaleSettlementID;
                this.ViewState["FormSaleSettlementID"] = FormSaleSettlementID;
                if (this.Request["RejectObjectID"] == null) {
                    this.DeleteBtn.Visible = true;
                } else {
                    this.DeleteBtn.Visible = false;
                }
                this.PaymentTypeDDL.SelectedValue = rowFormPayment.PaymentTypeID.ToString();
                PaymentTypeDDL_SelectedIndexChanged(null, null);
                this.InvoiceStatusDDL.SelectedValue = rowFormPayment.InvoiceStatusID.ToString();
                if (!rowFormPayment.IsRemarkNull()) {
                    this.RemarkCtl.Text = rowFormPayment.Remark;
                }
                if (!rowFormPayment.IsAttachedFileNameNull()) {
                    this.UCPaymentFile.AttachmentFileName = rowFormPayment.AttachedFileName;
                }
                if (!rowFormPayment.IsRealAttachedFileNameNull()) {
                    this.UCPaymentFile.RealAttachmentFileName = rowFormPayment.RealAttachedFileName;
                }
                if (!rowFormPayment.IsVendorIDNull()) {
                    this.UCVendor.VendorID = rowFormPayment.VendorID.ToString();
                }
                if (!rowFormPayment.IsFormPOIDNull()) {
                    this.UCPO.FormID = rowFormPayment.FormPOID.ToString();
                }
                if (!rowFormPayment.IsVatTypeIDNull()) {
                    VATTypeDDL.SelectedValue = rowFormPayment.VatTypeID.ToString();
                }

                new FormSalePaymentDetailTableAdapter().FillCurrentDataForNormal(this.InnerDS.FormSalePaymentDetail, rowFormPayment.FormSalePaymentID);
                new FormInvoiceTableAdapter().FillByFormID(this.InnerDS.FormInvoice, rowFormPayment.FormSalePaymentID);
            } else {
                this.DeleteBtn.Visible = false;
                FormSaleSettlementID = int.Parse(Request["FormSaleSettlementID"]);
                this.ViewState["FormSaleSettlementID"] = FormSaleSettlementID;
                new FormSalePaymentDetailTableAdapter().FillByFormSaleSettlementID(this.InnerDS.FormSalePaymentDetail, FormSaleSettlementID);
            }

            FormDS.FormSaleSettlementRow rowFormSettlement = this.FormSaleBLL.GetFormSaleSettlementByID(FormSaleSettlementID);
            FormDS.FormRow settlementForm = this.FormSaleBLL.GetFormByID(FormSaleSettlementID)[0];
            MasterData.CustomerRow customer = mdBLL.GetCustomerById(rowFormSettlement.CustomerID)[0];
            this.CustomerNameCtl.Text = customer.CustomerName;
            this.CustomerChannelCtl.Text = mdBLL.GetCustomerChannelById(customer.CustomerChannelID)[0].CustomerChannelName;
            this.CustomerRegionCtl.Text = mdBLL.GetCustomerRegionById(customer.CustomerRegionID).CustomerRegionName;
            this.CityCtl.Text = customer.City;
            this.BrandCtl.Text = mdBLL.GetBrandById(rowFormSettlement.BrandID)[0].BrandName;
            MasterData.ExpenseSubCategoryRow rowExpenseSubCategory = mdBLL.GetExpenseSubCategoryById(rowFormSettlement.ExpenseSubCategoryID);
            MasterData.ExpenseCategoryRow rowExpenseCategory = mdBLL.GetExpenseCategoryById(rowExpenseSubCategory.ExpenseCategoryID);
            this.ExpenseCategoryCtl.Text = rowExpenseCategory.ExpenseCategoryName;
            this.ExpenseSubCategoryCtl.Text = rowExpenseSubCategory.ExpenseSubCategoryName;
            this.ViewState["NeedPO"] = rowExpenseCategory.NeedPO;
            this.CurrencyCtl.Text = mdBLL.GetCurrencyByID(rowFormSettlement.CurrencyID).CurrencyShortName;
            this.ViewState["CostCenterID"] = this.FormSaleBLL.GetFormByID(FormSaleSettlementID)[0].CostCenterID;
            this.CostCenterCtl.Text = CommonUtility.GetMAACostCenterFullName(int.Parse(this.ViewState["CostCenterID"].ToString()));

            this.SettlementRemarkCtl.Text = rowFormSettlement.IsRemarkNull() ? "" : rowFormSettlement.Remark;
            if (!rowFormSettlement.IsAttachedFileNameNull())
                this.UCSettlementFile.AttachmentFileName = rowFormSettlement.AttachedFileName;
            if (!rowFormSettlement.IsRealAttachedFileNameNull())
                this.UCSettlementFile.RealAttachmentFileName = rowFormSettlement.RealAttachedFileName;
            this.SettlementFormNoCtl.Text = settlementForm.FormNo;
            this.SettlementFormNoCtl.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/FormSale/SettlementApproval.aspx?ShowDialog=1&ObjectId=" + FormSaleSettlementID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";

            //费用合计信息
            ApplyAmountRMBCtl.Text = rowFormSettlement.IsApplyAmountRMBNull() ? "" : rowFormSettlement.ApplyAmountRMB.ToString();
            ForecastOrderAmountCtl.Text = rowFormSettlement.IsForecastOrderAmountNull() ? "" : rowFormSettlement.ForecastOrderAmount.ToString();
            CostBenefitRateCtl.Text = rowFormSettlement.IsCostBenefitRateNull() ? "" : rowFormSettlement.CostBenefitRate.ToString();
            AmountRMBCtl.Text = rowFormSettlement.AmountRMB.ToString();
            ActualOrderAmountCtl.Text = rowFormSettlement.IsActualOrderAmountNull() ? "" : rowFormSettlement.ActualOrderAmount.ToString();
            ActualCostBenefitRateCtl.Text = rowFormSettlement.IsActualCostBenefitRateNull() ? "" : rowFormSettlement.ActualCostBenefitRate.ToString();
            this.odsSKUDetails.SelectParameters["FormSaleSettlementID"].DefaultValue = rowFormSettlement.FormSaleSettlementID.ToString();

            //判断是Activity还是NoActivity,如果NoActivity那么需要隐藏
            if (settlementForm.PageType == (int)SystemEnums.PageType.NoActivitySettlementApply) {
                this.FeeSumTR.Visible = false;
                this.SKUDiv.Visible = false;
                this.gvSKUDetails.Visible = false;
            }
        }
    }
예제 #12
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");
            }
            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.IsFormApplyNameNull()) {
                this.txtFormApplyName.Text = rowFormApply.FormApplyName;
            }

            //�鿴Ԥ����Ϣ��ť
            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") + "%";

            //����ҳ�洦��&��ť����
            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");
            }
            if (!rowFormApply.IsAccruedAmountNull()) {
                AccruedAmountCtl.Text = rowFormApply.AccruedAmount.ToString("N");
            }
            //����������˲���û��ִ��ȷ�ϣ�ʵ�ʷ��òſ��Ա༭
            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;
                    }
                }
            }

            // ����ϸ��
            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);
            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();
    }
예제 #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.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"];
    }