/// <summary> /// Проверка, изменились ли поля ввода, и запрос подтверждения, если изменились. Далее выход к списку сущностей /// </summary> private void ConfirmExitIfDataHasBeenChanged() { var isFieldsNotChanged = true; const int defaultSelectedIndexComboBox = -1; if (_editedMaterial == null) // Если сущность добавляется { isFieldsNotChanged &= MaterialComboBox.SelectedIndex == defaultSelectedIndexComboBox; isFieldsNotChanged &= MeasureComboBox.SelectedIndex == defaultSelectedIndexComboBox; isFieldsNotChanged &= string.IsNullOrWhiteSpace(MaterialNameTextBox.Text); isFieldsNotChanged &= string.IsNullOrWhiteSpace(MaterialGostTextBox.Text); isFieldsNotChanged &= string.IsNullOrWhiteSpace(MaterialProfileTextBox.Text); isFieldsNotChanged &= WorkGuildIdLongUpDown.Value == 0; isFieldsNotChanged &= ParcelIdLongUpDown.Value == 0; isFieldsNotChanged &= SignMaterialLongUpDown.Value == 0; isFieldsNotChanged &= NormUnitLongUpDown.Value == 0; isFieldsNotChanged &= string.IsNullOrWhiteSpace(AuxiliaryMaterialConsumptionRateTextBox.Text); isFieldsNotChanged &= string.IsNullOrWhiteSpace(MeasureShortNameTextBox.Text); isFieldsNotChanged &= string.IsNullOrWhiteSpace(FlowRateTextBox.Text); // проверка изменений внутренних полей класса isFieldsNotChanged &= _selectedMaterial == null; } else // Если сущность редактируется { isFieldsNotChanged &= Equals(MeasureComboBox.SelectedItem as Measure, _editedMaterial.Measure); isFieldsNotChanged &= Equals(WorkGuildIdLongUpDown.Text, _editedMaterial.WorkGuildId); isFieldsNotChanged &= Equals(ParcelIdLongUpDown.Text, _editedMaterial.ParcelId); isFieldsNotChanged &= Equals(SignMaterialLongUpDown.Text, _editedMaterial.SignMaterial); isFieldsNotChanged &= Equals(NormUnitLongUpDown.Text, _editedMaterial.UnitValidation); isFieldsNotChanged &= Equals(AuxiliaryMaterialConsumptionRateTextBox.Text.Trim(), _editedMaterial.AuxiliaryMaterialConsumptionRate); isFieldsNotChanged &= Equals(FlowRateTextBox.Text.Trim(), _editedMaterial.FlowRate); } // Если введённые поля изменились - запрос у пользователя подтверждения намерение выхода к списку сущностей if (!isFieldsNotChanged && !PageUtil.ConfirmBackToListWhenFieldChanged()) { return; } Close(); }
protected void Page_Load(object sender, EventArgs e) { Session["Local"] = "退料单"; if (!IsPostBack) { BindDrop(); SubinventoryDC subDC = new SubinventoryDC(); DataSet ds1 = subDC.getAllUsedSubinventory_name(); Wip_operationDC regDC = new Wip_operationDC(); DataSet ds2 = regDC.getRegion_nameBySubinventory_name(); if (ds1 != null) { Subinventory4.DataSource = ds1.Tables[0].DefaultView; Subinventory1.DataSource = ds1.Tables[0].DefaultView; Subinventory4.DataValueField = "subinventory_key"; Subinventory4.DataTextField = "subinventory_name"; Subinventory1.DataValueField = "subinventory_key"; Subinventory1.DataTextField = "subinventory_name"; Subinventory4.DataBind(); Subinventory1.DataBind(); } else { PageUtil.showToast(this.Page, "数据载入出错!"); } Subinventory1.Items.Insert(0, "选择库别"); if (ds2 != null) { seq_operation_num1.DataSource = ds2.Tables[0].DefaultView; seq_operation_num1.DataValueField = "route_id"; seq_operation_num1.DataBind(); } else { PageUtil.showToast(this.Page, "数据载入出错"); } seq_operation_num1.Items.Insert(0, "选择制程"); } }
protected void Page_Load(object sender, EventArgs e) { HB_ShiCZTItem item; UserInfo info; string str; bool flag; this.nUserId = FunUtil.GetCurrentUserID(this.Page); this.nId = Util.GetInt(base.Request, "id", -1); this.m_htCommonFill["m_strListUrl"] = PageUtil.GetDoFormActionUrl(base.Request, "DianChang_ShiCZT_ZhuTList", null); this.m_htCommonFill["m_strAddOn"] = string.Format("&id={0}&", (int)this.nId); SkinUtil.AdhereEntryStyleSheet(this.Page, "bootstrap.min.css"); SkinUtil.AdhereEntryStyleSheet(this.Page, "fileinput.css"); if ((base.IsPostBack == 0) != null) { goto Label_00A5; } goto Label_01BD; Label_00A5: item = HB_ShiCZTItem.Get(this.nId); info = UserInfo.Get(item.UserId); PageUtil.CommonFillHash(this.m_htCommonFill, 0, info, "_User", 0, 0, null); PageUtil.CommonFillHash(this.m_htCommonFill, 0, item, "", 0, 0, null); str = this.ltTemplate.Text; if (string.IsNullOrEmpty(item.YingYZZ) != null) { goto Label_0140; } this.m_htCommonFill["lblimg_YingYZZ"] = string.Format(str, PageUtil.GetTypeFieldAttachLink(this.Page, item, "YingYZZ", 1), PageUtil.GetTypeFieldAttachLink(this.Page, item, "YingYZZ", 11)); Label_0140: if (string.IsNullOrEmpty(item.DianLYWXKZ) != null) { goto Label_018B; } this.m_htCommonFill["lblimg_DianLYWXKZ"] = string.Format(str, PageUtil.GetTypeFieldAttachLink(this.Page, item, "DianLYWXKZ", 1), PageUtil.GetTypeFieldAttachLink(this.Page, item, "DianLYWXKZ", 11)); Label_018B: this.m_htCommonFill["txt_DiaoDGX_New"] = "省调直调电厂"; this.m_htCommonFill["txt_EnterDate_New"] = DateTimeUtil.DisplayDefaultDateTime(DateTime.Now, 0); Label_01BD: return; }
//待复验 protected void pending(object sender, EventArgs e) { table_type.InnerText = ""; Reinspect_Repeater.DataBind(); int curdate = DateTime.Now.Year * 100 + (int)Math.Ceiling(DateTime.Now.Day / 7.0); DataSet ds = reinspect.getallpending(curdate); if (ds != null && ds.Tables[0].Rows.Count > 0) { Label1.InnerText = "待复验"; Reinspect_Repeater2.DataSource = ds; Reinspect_Repeater2.DataBind(); } else { Label1.InnerText = ""; Reinspect_Repeater2.DataBind(); CleanAllMeassage_Click(sender, e); PageUtil.showToast(this, "无待复验数据!"); } }
private bool ValidInputs() { string ageFrom = this.txtAgeFrom.Value; string ageTo = this.txtAgeTo.Value; if (ageFrom.Length > 0 && !PageUtil.IsInteger(ageFrom)) { this.validationMessage.Text = "Age must be a number"; this.validationMessage.Visible = true; return(false); } if (ageTo.Length > 0 && !PageUtil.IsInteger(ageTo)) { this.validationMessage.Text = "Age must be a number"; this.validationMessage.Visible = true; return(false); } this.validationMessage.Visible = false; return(true); }
/// <summary> /// Initializes a new instance of the <see cref="WorldPages"/> class. /// </summary> /// <param name="previous">The previous.</param> /// <param name="flags">The flags.</param> /// <param name="party">The party.</param> public WorldPages(Page previous, Flags flags, Party party) : base(new Page("Areas")) { Root.Body = "Which area would you like to go to?"; Root.Icon = Util.GetSprite("journey"); Root.Condition = PageUtil.GetVisitProcessCondition(flags, party); IList <IButtonable> buttons = new List <IButtonable>(); buttons.Add(PageUtil.GenerateBack(previous)); Root.AddCharacters(Side.LEFT, party.Collection); foreach (AreaType type in AreaList.ALL_AREAS.Keys) { if (flags.IsAreaUnlocked(type) && flags.CurrentArea != type) { buttons.Add(GetAreaChangeProcess(type, flags, party, previous)); } } Root.Actions = buttons; }
private void bind() { User user = (User)Session["user"]; TeacherBLL teachBll = new TeacherBLL(); Teacher teacher = teachBll.getByUserId(user.Id); CommonBLL commonBll = new CommonBLL(); // 根据教师ID得到课程信息 string filter = "1=1"; filter += weekId.SelectedIndex == 0 ? "" : " and week='" + weekId.SelectedValue + "'"; DataTable dt = PageUtil.getProcessedDataTable(commonBll.getWorkAttendanceByTeachID(teacher.Id), filter); AspNetPager1.RecordCount = dt.Rows.Count; int from = (AspNetPager1.CurrentPageIndex - 1) * AspNetPager1.PageSize + 1; int to = from + AspNetPager1.PageSize - 1 > AspNetPager1.RecordCount ? AspNetPager1.RecordCount : from + AspNetPager1.PageSize - 1; GridView1.DataSource = PageUtil.getPaged(dt, from, to); GridView1.DataBind(); }
// 查询操作 protected void search_Click(object sender, EventArgs e) { string item_name = ITEM_name2.Value; string po_num = PO_num2.Value; string receipt_no = Rec_Num2.Value; DataSet list = poDC.getReceive_mtlByNotInstorage(receipt_no, item_name, po_num); if (list == null) { if (item_name == String.Empty && po_num == String.Empty && receipt_no == String.Empty) { PageUtil.showToast(this, "暂收表中无任何数据!"); } PageUtil.showToast(this, "未找到匹配信息!"); return; } PoStorage_Repeater.DataSource = list; PoStorage_Repeater.DataBind(); PO_num2.Value = string.Empty; Rec_Num2.Value = string.Empty; }
protected void Page_Load(object sender, EventArgs e) { AnnounceService announceService = new AnnounceService(); //公告总数 Announcerecord = announceService.GetRecordCount(""); //防止请求的pagenumber非法 int pagenumber = 1; if (!Int32.TryParse(Request["page"], out pagenumber)) { pagenumber = 1; } //分页后的公告列表 announceList = announceService.FindAnnounceByPage("", "atime desc", pagenumber); //分页 pageCode = PageUtil.genPagination("/ViewAnnounce.aspx", Announcerecord, pagenumber, announceService.pagesize, ""); }
protected void delete_issued_qty(object sender, EventArgs e) { string invoice_no = issue_no_search.Value; int issue_line_id = Convert.ToInt32(issue_line_id_Delet.Value); bool flag = issuli.delete_issue_line(issue_line_id); issue.DataSource = isuline.getIssueByinvoice_no(invoice_no); issue.DataBind(); issue2.DataSource = isuline.getIssueByinvoice_no(invoice_no); issue2.DataBind(); if (flag == true) { PageUtil.showToast(this, "删除成功!"); return; } else { PageUtil.showToast(this, "删除失败!"); return; } }
/// <summary> /// Returns true if the selected ProjectType needs an approval record, else false. /// </summary> /// <param name="projectType"></param> /// <returns></returns> private bool FormNeedsApprovalStep(string projectType) { LookupCodeDa da = new LookupCodeDa(); // LookupCode ProjectApprovalType should contain a single lookup value // used to link child codes as needing approval step. DataTable dt = da.GetLookupsByFieldName("ProjectApprovalType").Tables[0]; DataRow[] singleType = dt.Select("LkpCode = 'ProjectApprovalType'"); if (singleType.Length > 0) { int parentCodeId = int.Parse(singleType[0]["LookupCodeId"].ToString()); // Get all the ProjectTypes which need approval DataTable childCodes = da.GetChildCodesByLookupIdAndChildLookupName(parentCodeId, "ProjectType"); // If projectType is in this list, we need an approval step if (childCodes.Select("LkpCode = '" + PageUtil.EscapeSingleQuotesForSql(projectType) + "'").Length > 0) { return(true); } } return(false); }
protected void DropDownList_course_SelectedIndexChanged(object sender, EventArgs e) { CourseTableBLL ctBLL = new CourseTableBLL(); TeacherBLL teachBLL = new TeacherBLL(); DropDownList_teacher.Items.Clear(); string filterTeacher = "classID='" + DropDownList_class.SelectedValue + "' and courId='" + DropDownList_course.SelectedValue + "'"; DataTable tempDt = PageUtil.getProcessedDataTable(ctBLL.getAll().Tables[0], filterTeacher, null, false); DataView dv = tempDt.DefaultView; tempDt = dv.ToTable(true, "teachID"); foreach (DataRow dr in tempDt.Rows) { Teacher teacher = teachBLL.get(dr["teachID"].ToString()); DropDownList_teacher.Items.Add(new ListItem(teacher.Name, teacher.Id)); } bind(); }
private void GetSqlWhere() { //flag:表示查询条件是否为外包账单 ViewState["flag"] = chkSendOut.Checked == true ? "sendout" : "nosendout"; //设置当前页和每页显示记录数 PageUtil pageUtil = new PageUtil(gvList.PageIndex, gvList.PageSize); //查询条件 Hashtable ht = new Hashtable(); ht["status"] = "0"; ht["dictLabid"] = dropLab.SelectedValue.ToString() == "-1" ? null : dropLab.SelectedValue.ToString(); ht["customerid"] = dropCustomer.SelectedValue.ToString() == "-1" ? null : dropCustomer.SelectedValue.ToString(); ht["billheadid"] = tbxBillheadid.Text.Trim() == "" ? null : tbxBillheadid.Text.Trim(); ht["customertype"] = chkSendOut.Checked == true ? "1" : "0"; ht["pageStart"] = pageUtil.GetPageStartNum(); ht["pageEnd"] = pageUtil.GetPageEndNum(); ViewState["sqlWhere"] = ht; ViewState["dictlabname"] = dropLab.SelectedText; }
private void BindGrid(string testtype, string dictlabid) { //分页查询条件 PageUtil pageUtil = new PageUtil(gdTestItem.PageIndex, gdTestItem.PageSize); Hashtable ht1 = new Hashtable(); ht1.Add("strKey", TextUtility.ReplaceText(ttbSearch.Text.Trim()) == "" ? null : TextUtility.ReplaceText(ttbSearch.Text.Trim())); ht1.Add("pageStart", pageUtil.GetPageStartNum()); ht1.Add("pageEnd", pageUtil.GetPageEndNum()); ht1.Add("testtype", testtype); ht1.Add("Dictlabdeptid", dictlabid); ht1.Add("IsActive", chkActive.Checked ? "1" : "0"); //strtestitemid //设置总项数 gdTestItem.RecordCount = testitemservice.GetDictTestItemPageLstCount(ht1); List <Dicttestitem> list = testitemservice.GetDictTestItemPageLst(ht1); gdTestItem.DataSource = list; gdTestItem.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { poSelect(); List <String> vendor_key_List = new List <String>(); vendor_key_List = poDC.getAllVendor_key(); if (vendor_key_List != null) { vendor_keys.DataSource = vendor_key_List; vendor_keys.DataBind(); vendor_keys.Items.Insert(0, "选择厂商代码"); } else { PageUtil.showAlert(this, "无数据载入下拉框!"); } } Session["Local"] = "PO/POLine设定"; }
/// <summary> /// Initialize required variables, i.e., patientId and events /// </summary> protected void InitControl() { patientId = int.Parse(Session[SessionKey.PatientId].ToString()); isFormDirty = false; // track field changes on load this.Load += (o, e) => { var inputs = PageUtil.GetCaisisInputControlsInContainer(this); foreach (var input in inputs) { input.ValueChanged += MarkFormDirty; } var grid = PageUtil.GetControls <GridView>(this).Cast <Control>(); var rptr = PageUtil.GetControls <Repeater>(this).Cast <Control>();; var dataBoundComponenets = grid.Concat(rptr); foreach (var componenet in dataBoundComponenets) { InitDirtyControlTracking(componenet); } }; }
protected void UpdateButtonClick(object sender, CommandEventArgs e) { LookupCode biz = new LookupCode(); //biz.NewRow(); // erroneous call biz["LookupCodeId"] = lkpCodeId.Value; biz["LkpFieldName"] = lkpFieldName.Value; biz["LkpCode"] = lkpValue.Value; biz["LkpDescription"] = lkpDescription.Value; biz["LkpOrder"] = PageUtil.ObjToInt(lkpOrder.Value); biz["LkpSuppress"] = lkpSuppress.Checked; biz["UpdatedBy"] = User.Identity.Name; biz["UpdatedTime"] = DateTime.Now; biz["EnteredBy"] = User.Identity.Name; // these are required biz["EnteredTime"] = DateTime.Now; // biz.Save(); this.Page_Load(sender, e); }
private void BuildImgCompared(Control container, int?diagnosticId) { CaisisSelect imgCompared = FindInputControl(container, Diagnostic.ImgCompared) as CaisisSelect; if (imgCompared != null) { int patientId = int.Parse(BaseDecryptedPatientId); var allDiagnostics = new DiagnosticDa().GetDiagnosticsByType(patientId, ImageTypes).DefaultView; var prevDiagnostics = from diagnostic in allDiagnostics.Table.AsEnumerable() let rowDiagnosticId = (int)diagnostic[Diagnostic.DiagnosticId] let dxType = diagnostic[Diagnostic.DxType] let dxDate = diagnostic[Diagnostic.DxDate] // exclude current ? where !diagnosticId.HasValue || diagnosticId.Value != rowDiagnosticId // display text as "Bone Scan 01/26/2010" and value = diag id let displayText = string.Format("{0} {1:d}", dxType, dxDate) let sortDate = !diagnostic.IsNull(Diagnostic.DxDate) ? (DateTime)dxDate : DateTime.MaxValue orderby sortDate ascending select new { DiagnosticText = displayText, DiagnosticId = rowDiagnosticId }; // build dropdown imgCompared.DataSource = prevDiagnostics; imgCompared.DataBind(); // SPECIAL CASE: for current diagnostic, check if there is a related record, used as compare to for follow up scans if (diagnosticId.HasValue) { // get related diagnostic id var relatedDiagnostics = Caisis.Controller.RelatedRecordController.GetRelatedRecords("Diagnostics", diagnosticId.Value, "Diagnostics"); // set related diagnostic if (relatedDiagnostics.Count() > 0) { int relatedDiagnosticId = (int)relatedDiagnostics.First()[RelatedRecord.DestPrimaryKey]; PageUtil.SelectDropDownItem(imgCompared, relatedDiagnosticId.ToString()); } } } }
//插入按钮中的确定操作 protected void InsertMeassage_Click(object sender, EventArgs e) { String Subinventory_name_Insert = subinventory_name_Insert.Value; String Enabled_Insert = Request.Form["enabled_Insert"]; string Description_Insert = description_Insert.Value; try { if (subinventoryDC.getSubinventoryBySome(Subinventory_name_Insert, "", "") != null) { string temp_ToastString = "该条数据在数据库中已存在,插入失败!"; PageUtil.showToast(this, temp_ToastString); return; } //插入操作 bool flag; flag = subinventoryDC.insertSubinventory(Subinventory_name_Insert, user_id, Enabled_Insert, Description_Insert, DateTime.Now); if (flag == true) { string temp_ToastString = "该单号在数据库中存储成功!"; PageUtil.showToast(this, temp_ToastString); subinventoryRepeater.DataSource = subinventoryDC.getSubinventoryBySome(Subinventory_name_Insert, Enabled_Insert, Description_Insert); subinventoryRepeater.DataBind(); //清空插入成功后的插入框 subinventory_name_Insert.Value = ""; description_Insert.Value = ""; } else { string temp_ToastString = "该单号在数据库中存储失败!请检查输入是否超出范围"; PageUtil.showToast(this, temp_ToastString); } } catch (Exception ex) { string temp_ToastString = "请按格式输入,且不要超出范围"; PageUtil.showToast(this, temp_ToastString); } }
/// <summary> /// 对查询结果排序并绑定到Grid /// </summary> /// <param name="sortKey">排序</param> private void BindGridWithSort(string sortKey) { Hashtable htPara = new Hashtable(); PageUtil pageUtil = new PageUtil(gdOrders.PageIndex, gdOrders.PageSize); htPara.Add("pageStart", pageUtil.GetPageStartNum()); htPara.Add("pageEnd", pageUtil.GetPageEndNum()); htPara.Add("StartDate", dpFrom.Text); htPara.Add("EndDate", dpTo.Text); htPara.Add("dropDictLab", ddlDictLab.SelectedValue); htPara.Add("dictcustomerid", dropDictcustomer.SelectedValue); htPara.Add("status", ddlStatus.SelectedValue); htPara.Add("iolis", dropStatus.SelectedValue); htPara.Add("strKey", TextUtility.ReplaceText(tbKeyWord.Text)); htPara.Add("sortKey", sortKey); htPara.Add("strDoctor", TextUtility.ReplaceText(txtDoctor.Text.Trim())); htPara.Add("strLoginUser", Userinfo.userName); gdOrders.RecordCount = ordersService.CountForFinalCheck(htPara); DataTable dt = ordersService.DataForFinalCheck(htPara); //if (ddlStatus.SelectedValue == "20") //{ // gdOrders.FindColumn("chu").Hidden=false; // gdOrders.FindColumn("wan").Hidden = true; //} //else if (ddlStatus.SelectedValue == "25") //{ // gdOrders.FindColumn("chu").Hidden = false; // gdOrders.FindColumn("wan").Hidden = false; //} //else //{ // gdOrders.FindColumn("chu").Hidden = true; // gdOrders.FindColumn("wan").Hidden = true; //} gdOrders.DataSource = dt; gdOrders.DataBind(); gdOrders.SelectedRowIndexArray = null; }
//private ModelPO_line toModel(DataRow dr) //{ // ModelPO_line model = new ModelPO_line(); // foreach (PropertyInfo propertyInfo in typeof(ModelPO_line).GetProperties()) // { // //如果数据库的字段为空,跳过其赋值 // if (dr[propertyInfo.Name].ToString() == "") // { // continue; // } // //赋值 // model.GetType().GetProperty(propertyInfo.Name).SetValue(model, dr[propertyInfo.Name], null); // } // return model; //} //protected void QueryPO_Line_Click(object sender, EventArgs e) //{ // int Po_header_id_Query; // try // { // Po_header_id_Query = int.Parse(po_header_id_Query.Value); // } // catch // { // PageUtil.showToast(this, "未在数据库中查出对应数据,请检查是否输入有问题"); // return; // } // //查询 // modelPO_line_List = poLineDC.getPOLineByPo_header_id(Po_header_id_Query); // if (modelPO_line_List == null) // { // PageUtil.showToast(this, "未在数据库中查出对应数据,请检查是否输入有问题"); // } // po_Line_Repeater.DataSource = modelPO_line_List; // po_Line_Repeater.DataBind(); //} //PO单身的修改按钮------修改PO单身中的信息 protected void UpdatePO_Line_Click(object sender, EventArgs e) { string Cancel_flag_Update_poLine = cancel_flag_Update_poLine.Value; int item_id1 = 0, Request_qty_Update_poLine = 0; try { string PO_no2 = PO_NO2.Value; string item1 = Request.Form["Item1"];//现在传进来的是item_name //将item_name转换成item_id item_id1 = poDC.getItem_idByItem_name(item1); Request_qty_Update_poLine = int.Parse(request_qty_Update_poLine.Value); //若单号已经处于暂收即不允许再进行修改 if (poDC.getReceive_mtlByPo_no(PO_no2)) { PageUtil.showToast(this, PO_no2 + "单号已经开始暂收了,不可再修改!"); return; } //调用PO单身的方法修改数据 bool flag_poLineDC = poDC.updatePO_line(PO_no2, item_id1, Request_qty_Update_poLine, Cancel_flag_Update_poLine, int.Parse(line_num_Update_poLine.Value)); if (flag_poLineDC) { PageUtil.showToast(this, "修改成功!"); poSelect(); } else { PageUtil.showToast(this, "修改失败!请检查字符长度是否超出范围!"); this.CleanPO_Line_Update(); } } catch { PageUtil.showToast(this, "请按格式输入!"); this.CleanPO_Line_Update(); } }
/// <summary> /// 绑定列表 /// </summary> private void BindGrid() { try { //分页查询条件 PageUtil pageUtil = new PageUtil(gvList.PageIndex, gvList.PageSize); Hashtable ht1 = new Hashtable(); ht1.Add("strKey", Dp_Bingin.Text.ToString() == "" ? null : Dp_Bingin.Text); ht1.Add("endDate", this.DatePicker3.Text.ToString() == "" ? null : this.DatePicker3.SelectedDate.Value.AddDays(1).ToShortDateString()); ht1.Add("pageStart", pageUtil.GetPageStartNum()); ht1.Add("pageEnd", pageUtil.GetPageEndNum()); ht1.Add("Dictcustomerid", CustomerId); //设置总项数 gvList.RecordCount = cs.GetDictcustomerdiscountedPageLstCount(ht1); gvList.DataSource = cs.GetDictcustomerdiscountedPageDt(ht1); gvList.DataBind(); } catch (Exception ex) { MessageBoxShow(ex.Message, MessageBoxIcon.Error); } }
protected void Page_Load(object sender, EventArgs e) { Session["Local"] = "领料单作业"; if (Session["LoginName"] == null) { PageUtil.showToast(this, "未获取到你的登陆状态,请退出系统重新登录!"); return; } else { user = Session["LoginName"].ToString(); } if (!IsPostBack) { DataSet ds_Invoice_no = invoiceDC.getIssueInvoice_no(0); //DataSet ds_datecode = invoiceDC.getFrame(); if (ds_Invoice_no != null) { DropDownList_invoice_no.DataSource = ds_Invoice_no.Tables[0].DefaultView; DropDownList_invoice_no.DataValueField = "invoice_no"; DropDownList_invoice_no.DataTextField = "invoice_no"; DropDownList_invoice_no.DataBind(); } //if (ds_datecode != null) //{ // DropDownList_datecode.DataSource = ds_datecode.Tables[0].DefaultView; // DropDownList_datecode.DataValueField = "datecode"; // DropDownList_datecode.DataTextField = "datecode"; // DropDownList_datecode.DataBind(); //} DropDownList_invoice_no.Items.Insert(0, "--选择领料单号--"); //DropDownList_datecode.Items.Insert(0, "--选择datacode--"); } }
public bool ValidateDates() { string sDateFrom = this.dateFrom.Value; string sDateTo = this.dateTo.Value; if (!string.IsNullOrEmpty(sDateFrom)) { if (sDateFrom.Length > 0 && !PageUtil.IsDate(sDateFrom)) { return(false); } } if (!string.IsNullOrEmpty(sDateTo)) { if (sDateTo.Length > 0 && !PageUtil.IsDate(sDateTo)) { return(false); } } return(true); }
/// <summary> /// Populates the patient's baseline form /// </summary> private void PopulateBaselineForm() { int patientId = int.Parse(BaseDecryptedPatientId); int ptProtocolId = int.Parse(PatientProtocolId); var dataEntryControls = PageUtil.GetControls <BaseDataEntryControl>(BaselineFormPanel); // load patient Patient patient = new Patient(); patient.Get(patientId); // load patient protocol PatientProtocol ptProtocol = new PatientProtocol(); ptProtocol.Get(ptProtocolId); PatientProtocolController ptProtocolController = new PatientProtocolController(ptProtocolId); DateTime?onStudyDate = ptProtocolController.GetStatusDate(PatientProtocolController.OnStudy); DateTime?screeningFailedDate = ptProtocolController.GetStatusDate(PatientProtocolController.ScreeningFailed); DateTime?screeningPassedDate = ptProtocolController.GetStatusDate(PatientProtocolController.ScreeningPassed); // determine date ranges DateTime?baselineFromDate = null; DateTime?baselineToDate = onStudyDate ?? screeningFailedDate ?? screeningPassedDate; List <ICaisisInputControl> inputs = new List <ICaisisInputControl>(); // populate components foreach (BaseDataEntryControl control in dataEntryControls) { // set date ranges control.BaselineFromDate = baselineFromDate; // todo??? control.BaselineToDate = baselineToDate; control.Populate(); inputs.AddRange(CICHelper.GetCaisisInputControls(control)); } // add required field foreach (var control in inputs.Where(i => i.Required).OfType <WebControl>()) { control.Attributes["data-required"] = "true"; } }
//查询单头 protected void select1(object sender, EventArgs e) { Return_headerDC DC = new Return_headerDC(); string invoice_no = invoice_no4.Value; try { Line_Repeater.DataSource = DC.getReturn_headerByLikeINVOICE_NO(invoice_no); if (Line_Repeater.DataSource == null) { PageUtil.showToast(this, "数据库中没有对应数据,请添加数据后再查询"); } else { Line_Repeater.DataBind(); } } catch (Exception ex) { PageUtil.showToast(this.Page, "数据查询失败!"); } }
private static void RegisterHTM() { WebPageLocatorFactory.RegisterLocator(".htm", XamlPageLocator.Instance); WebPageExtensions.Register(".htm"); BuildProvider.RegisterBuildProvider(".htm", typeof(XPCBuildProvider)); //在VS里执行生成时,App_Code下的cs文件会自动编译,如果某个文件生成失败,那么整个生成操作(包括htm)会终止并且报错 //这就导致修改后的htm始终无法生成新的cs文件,因此,我们使用XPCBuildIgnoreProvider来让VS不执行cs的生成操作 BuildProvider.RegisterBuildProvider(".cs", typeof(XPCBuildIgnoreProvider)); #if (DEBUG) _watchers.Add(PageUtil.WatchFiles(".htm", (file, virtualPath) => { HtmlWatcher.Instance.OnChange(virtualPath); })); _watchers.Add(PageUtil.WatchFiles(".cs", (file, virtualPath) => { CSharpWatcher.Instance.OnChange(virtualPath); })); #endif }
public void searchPartNoAndPickedQty() { string Ship_no = ship_no.Value; string Wo_no = wo_no.Value; string part_no1, part_no2; if (String.IsNullOrWhiteSpace(Ship_no) || String.IsNullOrWhiteSpace(Wo_no)) { PageUtil.showToast(this, "请输入工单编号!"); return; } part_no1 = shipdc.getPartNoByWoNo(Wo_no); part_no2 = shipdc.getPartNoByShip_no(Ship_no); if (part_no1 == null || part_no2 == null || !part_no1.Equals(part_no2)) { wo_no.Attributes.Add("style", "border: #ff0000 1px solid;"); PageUtil.showToast(this, "工单输入错误!"); return; } wo_no.Attributes.Add("style", ""); part_no.Value = part_no1; ds = shipdc.getResQtyAndPicQtyByShip_no(Ship_no); if (ds.Tables[0].Rows[0]["picked_qty"].ToString() == null) { ship_qty.Value = "0"; } else { ship_qty.Value = ds.Tables[0].Rows[0]["picked_qty"].ToString(); } if (ds.Tables[0].Rows[0]["request_qty"].ToString() == null) { request_qty.Value = "0"; } else { request_qty.Value = ds.Tables[0].Rows[0]["request_qty"].ToString(); } }
/* * 'calculate RecTotActivity * 'check to be sure all numbers are present for calculating * If Not IsNull(txtIsotope) And IsNumeric(txtPrescribedDose) And IsNumeric(txtAvgDimension) Then * Select Case txtIsotope * Case "Palladium" * 'if we can ever figure out what these magic numbers mean, they * 'should go into the config table!!! * If CSng(txtAvgDimension) < CSng(3) Then * x = 17.8 * CSng(txtAvgDimension) * Else * x = 3.2 * (CSng(txtAvgDimension) ^ 2.56) * End If * sngRecTotActivity = 1.686 * x * CSng(txtPrescribedDose) / 140 * 1.1 'changed 3/23/2000 * * Case "Iodine" * If CSng(txtAvgDimension) < 3 Then * x = 5 * CSng(txtAvgDimension) * Else * x = 1.338 * (CSng(txtAvgDimension) ^ 2.2) * End If * sngRecTotActivity = 0.897 * 1.27 * x * CSng(txtPrescribedDose) / 144 * 1.1 * * End Select * txtRecTotActivity = sngRecTotActivity * blnDosimetrySaved = False * cmdPrintDosimetry.SetFocus 'prevent error in next line * cmdSaveDosimetry.Enabled = True * ElseIf Not blnPrePlan Then * blnComplete = False * End If */ public static string CalcRecTotActivity(string isotope, string prescribedDose, string avgDimension) { double recTotActivity = 0; if (PageUtil.IsDecimal(prescribedDose) && PageUtil.IsDecimal(avgDimension)) { double x; if (isotope.Equals("Palladium")) { if (double.Parse(avgDimension) < 3) { x = 17.8 * double.Parse(avgDimension); } else { x = 3.2 * (Math.Pow(double.Parse(avgDimension), 2.56)); } recTotActivity = 1.686 * x * double.Parse(prescribedDose) / 140 * 1.1; } else if (isotope.Equals("Iodine")) { if (double.Parse(avgDimension) < 3) { x = 5 * double.Parse(avgDimension); } else { x = 1.388 * Math.Pow(double.Parse(avgDimension), 2.2); } recTotActivity = 0.987 * 1.27 * x * double.Parse(prescribedDose) / 144 * 1.1; } } recTotActivity = RoundFloat(recTotActivity); return(recTotActivity.ToString()); }
//custom pager event private void pagerLnk_Click(object sender, EventArgs e) { int gotopage = 0; string btnId; LinkButton lnkbtn = (LinkButton)sender; btnId = lnkbtn.ID; if (btnId == "lnkPrev") { gotopage = 0; } else if (btnId == "lnkNext") { gotopage = dgAdminReport.PageCount - 1; } else if (PageUtil.IsInteger(this.ViewState[btnId].ToString())) { gotopage = int.Parse(this.ViewState[btnId].ToString()) - 1; } setCurrentPageOnPaging(gotopage); }