本文整理汇总了C#中BusinessObjects.MasterDataBLL.ToShortDateString方法的典型用法代码示例。如果您正苦于以下问题:C# MasterDataBLL.ToShortDateString方法的具体用法?C# MasterDataBLL.ToShortDateString怎么用?C# MasterDataBLL.ToShortDateString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BusinessObjects.MasterDataBLL
的用法示例。
在下文中一共展示了MasterDataBLL.ToShortDateString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
// 用户信息,职位信息
AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
AuthorizationDS.PositionRow rowUserPosition = (AuthorizationDS.PositionRow)Session["Position"];
if (new StuffUserBLL().GetCostCenterIDByPositionID(rowUserPosition.PositionId) == 0) {
this.Session["ErrorInfor"] = "未找到成本中心,请联系管理员";
Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
}
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());
}
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;
}
PurchaseDS.FormPORow rowFormPO = this.FormPurchaseBLL.GetFormPOByID(int.Parse(this.ViewState["ObjectId"].ToString()));
this.ViewState["ParentFormID"] = rowFormPO.ParentFormID;
this.ViewState["Period"] = rowFormPO.FPeriod.ToShortDateString();
this.PeriodCtl.Text = rowFormPO.FPeriod.ToString("yyyy-MM");
this.ViewState["VendorID"] = rowFormPO.VendorID.ToString();
this.ViewState["ItemCategoryID"] = rowFormPO.ItemCategoryID.ToString();
this.ViewState["PurchaseBudgetTypeID"] = rowFormPO.PurchaseBudgetTypeID.ToString();
this.ViewState["CurrencyID"] = rowFormPO.CurrencyID.ToString();
this.PurchaseTypeDDL.SelectedValue = rowFormPO.PurchaseTypeID.ToString();
this.ShippingTermDDL.SelectedValue = rowFormPO.ShippingTermID.ToString();
this.PaymentTermCtl.Text = rowFormPO.IsPaymentTermsNull() ? "" : rowFormPO.PaymentTerms;
if (!rowFormPO.IsCompanyIDNull()) {
this.CompanyDDL.SelectedValue = rowFormPO.CompanyID.ToString();
}
this.RemarkCtl.Text = rowFormPO.IsRemarkNull() ? "" : rowFormPO.Remark;
if (!rowFormPO.IsAttachedFileNameNull())
this.UCFileUpload.AttachmentFileName = rowFormPO.AttachedFileName;
if (!rowFormPO.IsRealAttachedFileNameNull())
this.UCFileUpload.RealAttachmentFileName = rowFormPO.RealAttachedFileName;
this.RealDeliveryAddressCtl.Text = rowFormPO.IsRealDeliveryAddressNull() ? "" : rowFormPO.RealDeliveryAddress;
new FormPODetailTableAdapter().FillByFormPOID(this.InnerDS.FormPODetail, rowFormPO.FormPOID);
} else {
this.DeleteBtn.Visible = false;
if (Request["ParentFormID"] != null) {
this.ViewState["ParentFormID"] = Request["ParentFormID"];
} else {
this.Session["ErrorInfor"] = "未找到申请单,请联系管理员";
Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
}
if (Request["PeriodPurchaseID"] != null) {
DateTime Period = new MasterDataBLL().GetPeriodPurchaseById(int.Parse(Request["PeriodPurchaseID"].ToString())).PeriodPurchase;
this.ViewState["Period"] = Period.ToShortDateString();
} else {
this.Session["ErrorInfor"] = "没有费用期间,请联系管理员";
Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
}
if (Request["VendorID"] != null) {
this.ViewState["VendorID"] = Request["VendorID"];
} else {
this.Session["ErrorInfor"] = "未找到Vendor,请联系管理员";
Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
}
if (Request["ItemCategoryID"] != null) {
this.ViewState["ItemCategoryID"] = Request["ItemCategoryID"];
} else {
this.Session["ErrorInfor"] = "未找到Item Category,请联系管理员";
Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
}
if (Request["PurchaseBudgetTypeID"] != null) {
this.ViewState["PurchaseBudgetTypeID"] = Request["PurchaseBudgetTypeID"];
} 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");
}
//.........这里部分代码省略.........
示例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);
// 用户信息,职位信息
AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
AuthorizationDS.PositionRow rowUserPosition = (AuthorizationDS.PositionRow)Session["Position"];
if (new StuffUserBLL().GetCostCenterIDByPositionID(rowUserPosition.PositionId) == 0) {
this.Session["ErrorInfor"] = "未找到成本中心,请联系管理员";
Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
}
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());
}
VATRateDDL.DataBind();
//如果是草稿进行赋值
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["PeriodPurchaseID"] != null) {
DateTime Period = new MasterDataBLL().GetPeriodPurchaseById(int.Parse(Request["PeriodPurchaseID"].ToString())).PeriodPurchase;
this.ViewState["Period"] = Period.ToShortDateString();
} else {
this.Session["ErrorInfor"] = "没有费用期间,请联系管理员";
Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
}
if (Request["VendorID"] != null) {
this.ViewState["VendorID"] = Request["VendorID"];
} else {
this.Session["ErrorInfor"] = "未找到Vendor,请联系管理员";
Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
}
if (Request["ItemCategoryID"] != null) {
this.ViewState["ItemCategoryID"] = Request["ItemCategoryID"];
} else {
this.Session["ErrorInfor"] = "未找到Item Category,请联系管理员";
Response.Redirect("~/ErrorPage/SystemErrorPage.aspx");
}
if (Request["PurchaseBudgetTypeID"] != null) {
this.ViewState["PurchaseBudgetTypeID"] = Request["PurchaseBudgetTypeID"];
} 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["Period"].ToString()).ToString("yyyy-MM");
this.PaymentTermCtl.Text = new MasterDataBLL().GetPaymentTermById(new VendorTableAdapter().GetDataByID(int.Parse(this.ViewState["VendorID"].ToString()))[0].PaymentTermID)[0].PaymentTermName;
}
MasterData.VendorRow vendor = new VendorTableAdapter().GetDataByID(int.Parse(this.ViewState["VendorID"].ToString()))[0];
this.VendorCodeCtl.Text = vendor.VendorCode;
this.VendorNameCtl.Text = vendor.VendorName;
this.VendorAddressCtl.Text = vendor.VendorAddress;
this.ItemCategoryCtl.Text = new ItemCategoryTableAdapter().GetDataByID(int.Parse(this.ViewState["ItemCategoryID"].ToString()))[0].ItemCategoryName;
this.CurrencyCtl.Text = new CurrencyTableAdapter().GetDataByID(int.Parse(this.ViewState["CurrencyID"].ToString()))[0].CurrencyShortName;
this.PurchaseBudgetTypeCtl.Text = new PurchaseBudgetTypeTableAdapter().GetDataByID(int.Parse(this.ViewState["PurchaseBudgetTypeID"].ToString()))[0].PurchaseBudgetTypeName;
this.ViewState["ExchangeRate"] = new MasterDataBLL().GetExchangeRateByPeriod(int.Parse(ViewState["CurrencyID"].ToString()), DateTime.Parse(ViewState["Period"].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().IsValidPeriodPurchase(DateTime.Parse(this.ViewState["Period"].ToString()))) {
this.SubmitBtn.Visible = false;
PageUtility.ShowModelDlg(this, "不允许申请本月的PV,请删除草稿并联系财务部!");
return;
}
//预算信息
decimal[] calculateAssistant = new decimal[6];
//.........这里部分代码省略.........