示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!this.IsPostBack) {
            PageUtility.SetContentTitle(this.Page, "��������");
            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.ViewState["FlowTemplate"] = new AuthorizationBLL().GetFlowTemplate((int)SystemEnums.BusinessUseCase.FormReimburse, stuffUser.StuffUserId);

            this.StuffNameCtl.Text = stuffUser.StuffName;
            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());
            }
            FormReimburseDetailTableAdapter taDetail = new FormReimburseDetailTableAdapter();

            //����Dzݸ���и�ֵ
            if (Request["ObjectId"] != null) {
                this.ViewState["ObjectId"] = int.Parse(Request["ObjectId"]);
                FormDS.FormReimburseRow rowFormReimbuese = this.SalesReimburseBLL.GetFormReimburseByID(int.Parse(this.ViewState["ObjectId"].ToString()))[0];
                if (this.Request["RejectObjectID"] == null) {
                    this.DeleteBtn.Visible = true;
                } else {
                    this.DeleteBtn.Visible = false;
                }
                this.ViewState["CustomerID"] = rowFormReimbuese.CustomerID;
                this.ViewState["FormApplyIds"] = rowFormReimbuese.FormApplyIds;
                this.ViewState["FormApplyNos"] = rowFormReimbuese.FormApplyNos;

                if (!rowFormReimbuese.IsRemarkNull()) {
                    this.RemarkCtl.Text = rowFormReimbuese.Remark;
                }
                if (!rowFormReimbuese.IsAttachedFileNameNull()) {
                    this.UCFileUpload.AttachmentFileName = rowFormReimbuese.AttachedFileName;
                }
                if (!rowFormReimbuese.IsRealAttachedFileNameNull()) {
                    this.UCFileUpload.RealAttachmentFileName = rowFormReimbuese.RealAttachedFileName;
                }
                new FormReimburseInvoiceTableAdapter().FillByFormReimburseID(this.InnerDS.FormReimburseInvoice, rowFormReimbuese.FormReimburseID);
                taDetail.FillCurrentDataByFormReimburseID(this.InnerDS.FormReimburseDetail, rowFormReimbuese.FormReimburseID);
                new FormReimburseSKUDetailTableAdapter().FillByFormReimburseID(this.InnerDS.FormReimburseSKUDetail, rowFormReimbuese.FormReimburseID);
            } else {
                this.DeleteBtn.Visible = false;

                if (Request["CustomerID"] != null) {
                    this.ViewState["CustomerID"] = Request["CustomerID"];
                } else {
                    this.Session["ErrorInfor"] = "δ�ҵ��ͻ�����������д";
                    Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
                }
                if (Request["FormApplyIds"] != null) {
                    this.ViewState["FormApplyIds"] = Request["FormApplyIds"];
                } 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");
                }
                // ��д��ϸ��
                taDetail.FillByFormApplyIds(this.InnerDS.FormReimburseDetail, this.ViewState["FormApplyIds"].ToString());

            }
            ERS.CustomerRow customer = new MasterDataBLL().GetCustomerById(int.Parse(this.ViewState["CustomerID"].ToString()));
            this.CustomerNameCtl.Text = customer.CustomerName;

            if (Session["ProxyStuffUserId"] != null) {
                this.SubmitBtn.Visible = false;
            }

        }
        TextBox newQuantityCtl = (TextBox)this.fvSKUDetails.FindControl("newQuantityCtl");
        newQuantityCtl.Attributes.Add("onchange", "ParameterChanged()");
    }
示例#2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!this.IsPostBack)
        {
            PageUtility.SetContentTitle(this.Page, "方案报销");
            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.ViewState["FlowTemplate"] = new AuthorizationBLL().GetFlowTemplate((int)SystemEnums.BusinessUseCase.FormReimburse, stuffUser.StuffUserId);

            this.StuffNameCtl.Text         = stuffUser.StuffName;
            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());
            }
            FormReimburseDetailTableAdapter taDetail = new FormReimburseDetailTableAdapter();

            //如果是草稿进行赋值
            if (Request["ObjectId"] != null)
            {
                this.ViewState["ObjectId"] = int.Parse(Request["ObjectId"]);
                FormDS.FormReimburseRow rowFormReimbuese = this.SalesReimburseBLL.GetFormReimburseByID(int.Parse(this.ViewState["ObjectId"].ToString()))[0];
                if (this.Request["RejectObjectID"] == null)
                {
                    this.DeleteBtn.Visible = true;
                }
                else
                {
                    this.DeleteBtn.Visible = false;
                }
                this.ViewState["PaymentTypeID"] = rowFormReimbuese.PaymentTypeID;
                this.ViewState["CustomerID"]    = rowFormReimbuese.CustomerID;
                this.ViewState["FormApplyIds"]  = rowFormReimbuese.FormApplyIds;
                this.ViewState["FormApplyNos"]  = rowFormReimbuese.FormApplyNos;

                if (!rowFormReimbuese.IsRemarkNull())
                {
                    this.RemarkCtl.Text = rowFormReimbuese.Remark;
                }
                if (!rowFormReimbuese.IsAttachedFileNameNull())
                {
                    this.UCFileUpload.AttachmentFileName = rowFormReimbuese.AttachedFileName;
                }
                if (!rowFormReimbuese.IsRealAttachedFileNameNull())
                {
                    this.UCFileUpload.RealAttachmentFileName = rowFormReimbuese.RealAttachedFileName;
                }
                new FormReimburseInvoiceTableAdapter().FillByFormReimburseID(this.InnerDS.FormReimburseInvoice, rowFormReimbuese.FormReimburseID);
                // 填写明细表,如果是票扣的话那么写入方法不一样
                if (int.Parse(this.ViewState["PaymentTypeID"].ToString()) == (int)SystemEnums.PaymentType.PiaoKou)
                {
                    taDetail.FillFromPKRecordByApplyNos(this.InnerDS.FormReimburseDetail, this.ViewState["FormApplyNos"].ToString());
                }
                else
                {
                    taDetail.FillCurrentDataByFormReimburseID(this.InnerDS.FormReimburseDetail, rowFormReimbuese.FormReimburseID);
                }
            }
            else
            {
                this.DeleteBtn.Visible = false;
                if (Request["PaymentTypeID"] != null)
                {
                    this.ViewState["PaymentTypeID"] = Request["PaymentTypeID"];
                }
                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["FormApplyIds"] != null)
                {
                    this.ViewState["FormApplyIds"] = Request["FormApplyIds"];
                }
                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");
                }
                // 填写明细表,如果是票扣的话那么写入方法不一样
                if (int.Parse(this.ViewState["PaymentTypeID"].ToString()) == (int)SystemEnums.PaymentType.PiaoKou)
                {
                    taDetail.FillFromPKRecordByApplyNos(this.InnerDS.FormReimburseDetail, this.ViewState["FormApplyNos"].ToString());
                }
                else
                {
                    taDetail.FillByFormApplyIds(this.InnerDS.FormReimburseDetail, this.ViewState["FormApplyIds"].ToString());
                }
            }
            ERS.CustomerRow customer = new MasterDataBLL().GetCustomerById(int.Parse(this.ViewState["CustomerID"].ToString()));
            this.CustomerNameCtl.Text         = customer.CustomerName;
            this.PaymentTypeDDL.SelectedValue = this.ViewState["PaymentTypeID"].ToString();

            if (Session["ProxyStuffUserId"] != null)
            {
                this.SubmitBtn.Visible = false;
            }
        }
    }