当前位置: 首页>>代码示例>>C#>>正文


C# MasterDataBLL.GetExpenseCategoryById方法代码示例

本文整理汇总了C#中BusinessObjects.MasterDataBLL.GetExpenseCategoryById方法的典型用法代码示例。如果您正苦于以下问题:C# MasterDataBLL.GetExpenseCategoryById方法的具体用法?C# MasterDataBLL.GetExpenseCategoryById怎么用?C# MasterDataBLL.GetExpenseCategoryById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BusinessObjects.MasterDataBLL的用法示例。


在下文中一共展示了MasterDataBLL.GetExpenseCategoryById方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

    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"];
//.........这里部分代码省略.........
开发者ID:hijoy,项目名称:CPL_ERS,代码行数:101,代码来源:NoActivityAdvancedPaymentApproval.aspx.cs

示例2: Page_Load

    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")) {
//.........这里部分代码省略.........
开发者ID:hijoy,项目名称:CPL_ERS,代码行数:101,代码来源:PaymentFreeGoodsApproval.aspx.cs

示例3: OpenForm

    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();
            }
        }
    }
开发者ID:hijoy,项目名称:CPL_ERS,代码行数:72,代码来源:ActivityApply.aspx.cs

示例4: Page_Load

    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;
            }
//.........这里部分代码省略.........
开发者ID:hijoy,项目名称:CPL_ERS,代码行数:101,代码来源:ActivityApply.aspx.cs

示例5: Page_Load


//.........这里部分代码省略.........
            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;
        }
    }
开发者ID:hijoy,项目名称:CPL_ERS,代码行数:101,代码来源:ActivitySettlementApply.aspx.cs

示例6: CreateBtn_Click

    protected void CreateBtn_Click(object sender, EventArgs e)
    {
        string strFormID = string.Empty;
        string strFormNo = string.Empty;
        bool isSameCustID = true;
        bool isSameBrandID = true;
        bool isSameYear = true;
        bool isSameSubCategoryID = true;
        bool isSameCurrencyID = true;
        bool isSameCostCenter = true;
        int custID = 0;
        int brandID = 0;
        int year = 0;
        int subCategoryID = 0;
        int currencyID = 0;
        int pageType = 0;
        decimal NeedCreatePOAmount = Convert.ToDecimal(ConfigurationManager.AppSettings["NeedCreatePOAmount"]);
        int costCenterID = 0;
        String NeedPOFormNo = string.Empty;

        MasterDataBLL masterBLL = new MasterDataBLL();
        FormPurchaseBLL purchaseBLL = new FormPurchaseBLL();
        string intFormID = string.Empty;
        foreach (GridViewRow row in this.gvApplyList.Rows) {
            CheckBox CheckCtl = (CheckBox)row.FindControl("CheckCtl");
            if (CheckCtl.Checked) {
                QueryDS.FormSaleApplyViewRow formApply = new FormQueryBLL().GetFormSaleApplyViewByID((int)this.gvApplyList.DataKeys[row.RowIndex].Value);
                FormDS.FormRow form = new FormSaleBLL().GetFormByID((int)this.gvApplyList.DataKeys[row.RowIndex].Value)[0];
                intFormID = formApply.FormID.ToString();
                pageType = formApply.PageType;
                if (custID == 0) {
                    custID = formApply.CustomerID;
                } else {
                    if (custID != formApply.CustomerID) {
                        isSameCustID = false;
                        break;
                    }
                }
                if (brandID == 0) {
                    brandID = formApply.BrandID;
                } else {
                    if (brandID != formApply.BrandID) {
                        isSameBrandID = false;
                        break;
                    }
                }
                if (year == 0) {
                    year = formApply.FPeriod.AddMonths(5).Year;
                } else {
                    if (year != formApply.FPeriod.AddMonths(5).Year) {
                        isSameYear = false;
                        break;
                    }
                }
                if (subCategoryID == 0) {
                    subCategoryID = formApply.ExpenseSubCategoryID;
                } else {
                    if (subCategoryID != formApply.ExpenseSubCategoryID) {
                        isSameSubCategoryID = false;
                        break;
                    }
                }
                if (currencyID == 0) {
                    currencyID = formApply.CurrencyID;
                } else {
                    if (currencyID != formApply.CurrencyID) {
                        isSameCurrencyID = false;
                        break;
                    }
                }
                if (strFormID == string.Empty) {
                    strFormID = this.gvApplyList.DataKeys[row.RowIndex].Value.ToString();
                } else {
                    strFormID = strFormID + "," + this.gvApplyList.DataKeys[row.RowIndex].Value.ToString();
                }
                if (strFormNo == string.Empty) {
                    strFormNo = "P" + form.FormNo + "P";
                } else {
                    strFormNo = strFormNo + "P" + form.FormNo + "P";
                }
                if (costCenterID == 0) {
                    costCenterID = formApply.CostCenterID;
                } else {
                    if (costCenterID != formApply.CostCenterID) {
                        isSameCostCenter = false;
                        break;
                    }
                }

                //�жϽ�����X����Ҫ�½�PO
                MasterData.ExpenseCategoryRow ecr = masterBLL.GetExpenseCategoryById(masterBLL.GetExpenseSubCategoryById(formApply.ExpenseSubCategoryID).ExpenseCategoryID);
                if (formApply.AmountRMB > NeedCreatePOAmount && ecr.NeedPO) {
                    if (purchaseBLL.QueryPOCountByParentFormID(formApply.FormID) <= 0) {
                        NeedPOFormNo += formApply.FormNo + ",";
                    }
                }
            }
        }

        if (strFormID == string.Empty) {
//.........这里部分代码省略.........
开发者ID:hijoy,项目名称:CPL_ERS,代码行数:101,代码来源:SaleApplySelectList.aspx.cs

示例7: Page_Load

    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.FormMarketingBLL.GetFormByID(formID)[0];
            FormDS.FormMarketingApplyRow rowFormApply = this.FormMarketingBLL.GetFormMarketingApplyByID(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");

            this.CustomerChannelCtl.Text = MasterDataBLL.GetCustomerChannelById(rowFormApply.CustomerChannelID)[0].CustomerChannelName;
            this.BrandCtl.Text = MasterDataBLL.GetBrandById(rowFormApply.BrandID)[0].BrandName;
            this.CurrencyCtl.Text = MasterDataBLL.GetCurrencyByID(rowFormApply.CurrencyID).CurrencyShortName;
            this.ExchangeRateCtl.Text = rowFormApply.ExchangeRate.ToString();
            if (!rowFormApply.IsMarketingProjectIDNull()) {
                this.ProjectNameCtl.Text = MasterDataBLL.GetMarketingProjectById(rowFormApply.MarketingProjectID).MarketingProjectName;
            }
            this.ExpenseCategoryCtl.Text = mdBLL.GetExpenseCategoryById(rowFormApply.ExpenseCategoryID).ExpenseCategoryName;

            //历史单据
            if (rowForm.IsRejectedFormIDNull()) {
                lblRejectFormNo.Text = "无";
            } else {
                FormDS.FormRow rejectedForm = this.FormMarketingBLL.GetFormByID(rowForm.RejectedFormID)[0];
                this.lblRejectFormNo.Text = rejectedForm.FormNo;
                this.lblRejectFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/FormMarketing/MarketingApproval.aspx?ShowDialog=1&ObjectId=" + rejectedForm.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;

            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.CostCenterCtl.Text = CommonUtility.GetMAACostCenterFullName(rowForm.CostCenterID);

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

            //明细
            this.odsDetails.SelectParameters["FormMarketingApplyID"].DefaultValue = rowFormApply.FormMarketingApplyID.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.ViewState["IsView"] = false;
            } else {
                this.SubmitBtn.Visible = false;
                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;
            }

            //是否显示报销完成按钮
            this.CloseBtn.Visible = false;
            if ((!rowFormApply.IsClose) && rowForm.StatusID == (int)SystemEnums.FormStatus.ApproveCompleted) {
                if (stuffUser.StuffUserId == rowForm.UserID || new AuthorizationBLL().GetProxyReimburseByParameter(rowForm.UserID, stuffUser.StuffUserId, rowForm.SubmitDate).Count > 0) {
                    this.CloseBtn.Visible = true;
                }
            }

            //如果是弹出,取消按钮不可见
//.........这里部分代码省略.........
开发者ID:hijoy,项目名称:CPL_ERS,代码行数:101,代码来源:MarketingApproval.aspx.cs

示例8: OpenForm

    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);
    }
开发者ID:hijoy,项目名称:CPL_ERS,代码行数:48,代码来源:NoActivityApply.aspx.cs

示例9: Page_Load

    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());
            }
            VATTypeDDL.DataBind();
            PaymentTypeDDL.DataBind();
            PaymentTypeDDL_SelectedIndexChanged(null, null);
            InvoiceStatusDDL.DataBind();
            //如果是草稿进行赋值
            int formApplyID;
            if (Request["ObjectId"] != null) {
                this.ViewState["ObjectId"] = int.Parse(Request["ObjectId"]);
                FormDS.FormRDPaymentRow rowFormPayment = this.FormRDBLL.GetFormRDPaymentByID(int.Parse(this.ViewState["ObjectId"].ToString()));
                formApplyID = rowFormPayment.FormRDApplyID;
                this.ViewState["FormRDApplyID"] = formApplyID;
                if (this.Request["RejectObjectID"] == null) {
                    this.DeleteBtn.Visible = true;
                } else {
                    this.DeleteBtn.Visible = false;
                }
                //赋值备注等
                this.PaymentTypeDDL.SelectedValue = rowFormPayment.PaymentTypeID.ToString();
                PaymentTypeDDL_SelectedIndexChanged(null, null);
                InvoiceStatusDDL.DataBind();
                if (!rowFormPayment.IsVATTypeIDNull()) {
                    VATTypeDDL.SelectedValue = rowFormPayment.VATTypeID.ToString();
                }
                this.InvoiceStatusDDL.SelectedValue = rowFormPayment.InvoiceStatusID.ToString();
                if (!rowFormPayment.IsPaymentFileNameNull()) {
                    this.UCFliePayment.AttachmentFileName = rowFormPayment.PaymentFileName;
                }
                if (!rowFormPayment.IsPaymentRealFileNameNull()) {
                    this.UCFliePayment.RealAttachmentFileName = rowFormPayment.PaymentRealFileName;
                }
                if (!rowFormPayment.IsRemarkNull()) {
                    this.RemarkCtl.Text = rowFormPayment.Remark;
                }
                new FormRDPaymentDetailTableAdapter().FillCurrentData(this.InnerDS.FormRDPaymentDetail, rowFormPayment.FormRDPaymentID, rowFormPayment.FormRDApplyID);
                new FormInvoiceTableAdapter().FillByFormID(this.InnerDS.FormInvoice, rowFormPayment.FormRDPaymentID);
            } else {
                formApplyID = int.Parse(Request["FormRDApplyID"]);
                this.ViewState["FormRDApplyID"] = formApplyID;
                new FormRDPaymentDetailTableAdapter().FillByRDApplyID(this.InnerDS.FormRDPaymentDetail, formApplyID);
            }
            MasterDataBLL mdBLL = new MasterDataBLL();
            this.FormNoCtl.Text = this.FormRDBLL.GetFormByID(formApplyID)[0].FormNo;
            FormDS.FormRDApplyRow rowFormApply = this.FormRDBLL.GetFormRDApplyByID(formApplyID)[0];
            this.PeriodCtl.Text = rowFormApply.FPeriod.ToString("yyyy-MM");

            this.CustomerChannelCtl.Text = mdBLL.GetCustomerChannelById(rowFormApply.CustomerChannelID)[0].CustomerChannelName;
            this.BrandCtl.Text = mdBLL.GetBrandById(rowFormApply.BrandID)[0].BrandName;
            this.CurrencyCtl.Text = mdBLL.GetCurrencyByID(rowFormApply.CurrencyID).CurrencyShortName;
            this.ExchangeRateCtl.Text = rowFormApply.ExchangeRate.ToString();
            MasterData.ExpenseSubCategoryRow rowExpenseSubCategory = mdBLL.GetExpenseSubCategoryById(rowFormApply.ExpenseSubCategoryID);
            MasterData.ExpenseCategoryRow rowExpenseCategory = mdBLL.GetExpenseCategoryById(rowExpenseSubCategory.ExpenseCategoryID);
            this.ExpenseSubCategoryCtl.Text = rowExpenseSubCategory.ExpenseSubCategoryName;
            this.ViewState["NeedPO"] = rowExpenseCategory.NeedPO;
            if (!rowFormApply.IsProjectNameNull()) {
                this.ProjectNameCtl.Text = rowFormApply.ProjectName;
            }

            this.ProjectDescCtl.Text = rowFormApply.IsProjectDescNull() ? "" : rowFormApply.ProjectDesc;
            if (!rowFormApply.IsApplyFileNameNull())
                this.UCFileApply.AttachmentFileName = rowFormApply.ApplyFileName;
            if (!rowFormApply.IsApplyRealFileNameNull())
                this.UCFileApply.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");
            }
            this.ViewState["CostCenterID"] = this.FormRDBLL.GetFormByID(int.Parse(this.ViewState["FormRDApplyID"].ToString()))[0].CostCenterID;
            this.CostCenterCtl.Text = CommonUtility.GetMAACostCenterFullName(int.Parse(this.ViewState["CostCenterID"].ToString()));
        }
    }
开发者ID:hijoy,项目名称:CPL_ERS,代码行数:96,代码来源:RDPaymentApply.aspx.cs

示例10: Page_Load

    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();
//.........这里部分代码省略.........
开发者ID:hijoy,项目名称:CPL_ERS,代码行数:101,代码来源:ActivityApproval.aspx.cs

示例11: Page_Load

    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();
//.........这里部分代码省略.........
开发者ID:hijoy,项目名称:CPL_ERS,代码行数:101,代码来源:PaymentCashApply.aspx.cs

示例12: Page_Load

    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());
            }

            //如果是草稿进行赋值
            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.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);
            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.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;
            //促销信息
            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()) {
//.........这里部分代码省略.........
开发者ID:hijoy,项目名称:CPL_ERS,代码行数:101,代码来源:ActivityAdvancedPaymentApply.aspx.cs

示例13: gvApplyList_RowCommand

    protected void gvApplyList_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Apply") {
            String[] param = e.CommandArgument.ToString().Split(',');
            int FormID = Convert.ToInt32(param[0]);
            decimal ApplyAmount = Convert.ToDecimal(param[1]);
            int PageType = Convert.ToInt32(param[2]);
            FormDS.FormSaleApplyRow formApply = new FormSaleBLL().GetFormSaleApplyByID(FormID)[0];
            MasterDataBLL masterBLL = new MasterDataBLL();
            MasterData.ExpenseCategoryRow ecr = masterBLL.GetExpenseCategoryById(masterBLL.GetExpenseSubCategoryById(formApply.ExpenseSubCategoryID).ExpenseCategoryID);

            decimal NeedCreatePOAmount = Convert.ToDecimal(ConfigurationManager.AppSettings["NeedCreatePOAmount"]);
            if (ApplyAmount > NeedCreatePOAmount && ecr.NeedPO) {
                if (FormPurchaseBLL.QueryPOCountByParentFormID(FormID) <= 0) {
                    PageUtility.ShowModelDlg(this, String.Format("���������{0}�������ȴ���PO!", NeedCreatePOAmount), String.Format("You need create po first when amount more than {0}!", NeedCreatePOAmount));
                    return;
                }
            }
            if (PageType == (int)SystemEnums.PageType.ActivityApply) {
                if (this.ViewState["SearchCondition"] != null) {
                    this.Response.Redirect("~/FormSale/ActivityAdvancedPaymentApply.aspx?FormSaleApplyID=" + FormID + "&Source=" + HttpUtility.UrlEncode("~/FormSale/SaleApplySelectListForAdvanced.aspx?" + this.ViewState["SearchCondition"].ToString()));
                } else {
                    this.Response.Redirect("~/FormSale/ActivityAdvancedPaymentApply.aspx?FormSaleApplyID=" + FormID + "&Source=" + HttpUtility.UrlEncode("~/FormSale/SaleApplySelectListForAdvanced.aspx"));
                }
            } else {
                if (this.ViewState["SearchCondition"] != null) {
                    this.Response.Redirect("~/FormSale/NoActivityAdvancedPaymentApply.aspx?FormSaleApplyID=" + FormID + "&Source=" + HttpUtility.UrlEncode("~/FormSale/SaleApplySelectListForAdvanced.aspx?" + this.ViewState["SearchCondition"].ToString()));
                } else {
                    this.Response.Redirect("~/FormSale/NoActivityAdvancedPaymentApply.aspx?FormSaleApplyID=" + FormID + "&Source=" + HttpUtility.UrlEncode("~/FormSale/SaleApplySelectListForAdvanced.aspx"));
                }
            }
        }
    }
开发者ID:hijoy,项目名称:CPL_ERS,代码行数:33,代码来源:SaleApplySelectListForAdvanced.aspx.cs


注:本文中的BusinessObjects.MasterDataBLL.GetExpenseCategoryById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。