void btnko_Click(object sender, EventArgs e) { try { using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { var tp = from a in db.CommitInAssets where a.CommitInTest.CommitInMaterialsLeader.CommitInMaterials.CommitProduce.StorageInID == Convert.ToInt32(Request.QueryString["StorageInID"]) && a.CommitInTest.CommitInMaterialsLeader.CommitInMaterials.CommitProduce.BatchIndex == Request.QueryString["QCBatch"].ToString() select a; if (tp.ToArray().Length > 0) { ClientScript.RegisterClientScriptBlock(typeof(string), "ShowMessage", "<script>alert('不能重复插入记录! ')</script>"); this.btnko.Enabled = false; return; } for (int i = 0; i < this.gv.Rows.Count; i++) { CommitInAssets sia = new CommitInAssets(); sia.TestID = Convert.ToInt32(this.gv.Rows[i].Cells[this.gv.Columns.Count - 1].Text.ToString()); DropDownList ddlunit = (DropDownList)(this.gv.Rows[i].Cells[7].Controls[0]); sia.CurUnit = ddlunit.SelectedItem.Text; TextBox unitprice = (TextBox)(this.gv.Rows[i].Cells[8].Controls[0]); sia.UnitPrice = Convert.ToDecimal(unitprice.Text.Trim()); TextBox amount = (TextBox)(this.gv.Rows[i].Cells[9].Controls[0]); sia.Amount = Convert.ToDecimal(amount.Text.Trim()); TextBox reportNum = (TextBox)(this.gv.Rows[i].Cells[10].Controls[0]); sia.BillCode = reportNum.Text.Trim(); TextBox material = (TextBox)(this.gv.Rows[i].Cells[11].Controls[0]); sia.MaterialsAttribute = material.Text.Trim(); sia.financeCode = "0"; var SevTime = db.ExecuteQuery <DateTime>("select getdate()", new object[] { }); sia.CreateTime = SevTime.First(); sia.Creator = reEmpId(SPContext.Current.Web.CurrentUser.LoginName); db.CommitInAssets.InsertOnSubmit(sia); db.SubmitChanges(); } //存库标识 ViewState["Temp"] = flag = true; this.btnko.Enabled = false; } //Response.Redirect("QualifiedManage.aspx?StorageInID=" + Request.QueryString["StorageInID"] + "&&TaskStorageID=" + Request.QueryString["TaskStorageID"] + "&&QCBatch=" + Request.QueryString["QCBatch"] + " "); } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_INSERTERROR)); } }
protected void Page_Load(object sender, EventArgs e) { try { this._taskid = Convert.ToInt32(Request.QueryString["TaskID"]); using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { TaskStorageIn tsi = db.TaskStorageIn.SingleOrDefault(u => u.TaskStorageID == _taskid); _executor = tsi.TaskCreaterID; _subdocid = tsi.StorageInID; _stocktakingid = db.SrinStocktaking.SingleOrDefault(u => u.TaskID.Equals(_taskid)).SrinStocktakingID; strBackUrl = string.Format("RiMaterialStocktaking.aspx?TaskID={0}", _taskid); } InitializeCustomControls(); BindDataToCustomControls(); ShowCustomControls(); } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR)); } }
protected void Page_Load(object sender, EventArgs e) { try { _taskid = Convert.ToInt32(Request.QueryString["TaskID"]); using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { StorageOutTask sot = db.StorageOutTask.SingleOrDefault(u => u.TaskID == this._taskid); _noticeid = sot.NoticeID; //分支流程--任务已经完成的情况 if (sot.TaskState.Equals("已完成")) { Response.Redirect(string.Format("NormalOutAssetAuditMessage.aspx?TaskID={0}", _taskid), false); return; } } InitializeCustomControls(); BindDataToCustomControls(); ShowCustomControls(); } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR)); } }
void chbShowAll_CheckedChanged(object sender, EventArgs e) { try { if (!chbShowAll.Checked) { chbShowAll.Enabled = true; } else { txtMaterialName.Text = string.Empty; txtFinanceCode.Text = string.Empty; txtSpecificationModel.Text = string.Empty; chbShowAll.Enabled = false; } Response.AddHeader("Refresh", "0"); } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR)); } }
void btnOK_Click(object sender, EventArgs e) { try { using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { //完成当前任务 TaskStorageIn tsi = db.TaskStorageIn.SingleOrDefault(u => u.TaskStorageID == _taskid); if (tsi.TaskState.Equals("未完成"))//分支流程--处理IE回退 { tsi.TaskState = "已完成"; } db.SubmitChanges(); Response.Redirect("../../default-old.aspx", false); } } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_INSERTERROR)); } }
private void ModifyDetails() { try { using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { StorageCommitOutDetails scod; foreach (GridViewRow gvr in this.spgvMaterial.Rows) { scod = db.StorageCommitOutDetails.SingleOrDefault(u => u.StorageCommitOutDetailsID == Convert.ToInt32(gvr.Cells[11].Text)); scod.Gentaojian = Convert.ToDecimal((gvr.Cells[5].Controls[0] as TextBox).Text.Trim()); scod.Metre = Convert.ToDecimal((gvr.Cells[7].Controls[0] as TextBox).Text.Trim()); scod.Ton = Convert.ToDecimal((gvr.Cells[9].Controls[0] as TextBox).Text.Trim()); scod.Remark = (gvr.Cells[10].Controls[0] as TextBox).Text.Trim(); scod.CreateTime = db.ExecuteQuery <DateTime>("select getdate()", new object[] { }).First(); db.SubmitChanges(); } } } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_UPDATEERROR)); } }
/// <summary> /// 自动完成数量 /// </summary> private void autoComplite() { try { using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { for (int i = 0; i < this.gv.Rows.Count; i++) { TextBox tboxCount = (TextBox)(this.gv.Rows[i].Cells[5].Controls[0]); switch ((this.gv.Rows[i].Cells[6].Controls[0] as TextBox).Text.Trim()) { case "根/台/套/件": tboxCount.Text = this.gv.Rows[i].Cells[2].Text; break; case "米": tboxCount.Text = this.gv.Rows[i].Cells[3].Text; break; case "吨": tboxCount.Text = this.gv.Rows[i].Cells[4].Text; break; } } } } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR)); } }
protected void Page_Load(object sender, EventArgs e) { try { this._subdocid = Convert.ToInt32(Request.QueryString["SubDocID"]); _taskid = string.IsNullOrEmpty(Request.QueryString["TaskID"]) ? 0 : Convert.ToInt32(Request.QueryString["TaskID"]); isValidate = Convert.ToBoolean(Request.QueryString["IsValidate"]);//是否验证该回收分单单已进入流程 if (isValidate) { if (SubDocIsInProcess()) { Response.Redirect(string.Format("ViewSrinSubDetails.aspx?SubDocID={0}", _subdocid), false); return; } } InitializeCustomControls(); BindDataToCustomControls(); ShowCustomControls(); } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR)); } }
void btnOK_Click(object sender, EventArgs e) { try { if (lblResult.Text.Equals("未通过")) { Response.Redirect(string.Format("CreateSrinTask.aspx?TaskID={0}&WorkID={1}&TaskType=处理物资组长审核问题&Executor={2}", _taskid, _formid, _executor), false); } else { using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { TaskStorageIn tsi = db.TaskStorageIn.SingleOrDefault(u => u.TaskStorageID.Equals(_taskid)); tsi.TaskState = "已完成"; db.SubmitChanges(); } Response.Redirect("../../default-old.aspx", false); } } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_UPDATEERROR)); } }
protected void Page_Load(object sender, EventArgs e) { try { _taskid = Convert.ToInt32(Request.QueryString["TaskID"]); using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { StorageOutTask sot = db.StorageOutTask.SingleOrDefault(u => u.TaskID == this._taskid); _noticeid = sot.NoticeID; //strModifyOpinion = string.Format("<br><br><font style=\"color:red;font-weight: bold;font-size: x-small;\">修改意见:</font><p align=\"left\" style=\"TEXT-INDENT: 5em;font-weight: bold;font-size: x-small;\">{0}</p>", sot.Remark.Trim()); } InitializeCustomControls(); BindDataToCustomControls(); ShowCustomControls(); } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR)); } }
protected void Page_Load(object sender, EventArgs e) { try { this._taskid = Convert.ToInt32(Request.QueryString["TaskID"]); using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { TaskStorageIn tsi = db.TaskStorageIn.SingleOrDefault(u => u.TaskStorageID == _taskid); //分支流程--任务已经完成的情况 if (tsi.TaskState.Equals("已完成")) { Response.Redirect(string.Format("RiProduceApplyReportMessage.aspx?TaskID={0}", _taskid), false); return; } //分支流程--已经生成回收入库单(合格)的情况 if (db.SrinRepairReport.Count(u => u.TaskID.Equals(_taskid)) != 0) { bcreated = true; } _transferid = tsi.StorageInID; } InitializeCustomControls(); BindDataToCustomControls(); ShowCustomControls(); } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR)); } }
protected void Page_Load(object sender, EventArgs e) { _taskid = Convert.ToInt32(Request.QueryString["TaskID"]); _type = Request.QueryString["Type"]; _workid = Convert.ToInt32(Request.QueryString["WorkID"]); try { using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { _receiptid = db.SrinReceipt.SingleOrDefault(u => u.SrinStocktakingConfirm.SrinStocktaking.TaskID.Equals(_taskid)).SrinReceiptID; } InitializeCustomControls(); BindDataToCustomControls(); ShowCustomControls(); } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR)); } }
private int reEmpId(string Emp) { int valueEmp = 0; try { using (MMSProDBDataContext dc = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { EmpInfo EI = dc.EmpInfo.SingleOrDefault(u => u.Account == Emp); if (EI != null) { valueEmp = EI.EmpID; } } } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_QUERYERROR)); } return(valueEmp); }
private bool RealDetailsIsDone() { try { using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { if (db.StorageOutRealDetails.Count(u => u.StorageOutNoticeID.Equals(_noticeid)) != 0) { return(true); } else { return(false); } } } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_QUERYERROR)); return(false); } }
protected void tbarbtnAdd_Click(object sender, EventArgs e) { try { if (!string.IsNullOrEmpty(Request.QueryString["TaskStorageID"])) { ClientScript.RegisterClientScriptBlock(typeof(string), "Messages", "<script>alert('回退任务不能新增批次.')</script>"); return; } else { Response.Redirect("StorageDetailedCreate.aspx?StorageInID=" + _storageInID + ""); } } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_QUERYERROR)); } //ClientScript.RegisterClientScriptBlock(typeof(string), "ShowMessage", "<script>alert('hello! ')</script>"); }
protected void Page_Load(object sender, EventArgs e) { try { _noticeid = Convert.ToInt32(Request.QueryString["NoticeID"]); strBackUrl = Request.QueryString["BackUrl"]; if (string.IsNullOrEmpty(strBackUrl)) { strBackUrl = string.Format("ManageCommitOutDetails.aspx?NoticeID={0}", _noticeid); } else { strBackUrl = HttpUtility.UrlDecode(strBackUrl); } InitializeCustomControls(); BindDataToCustomControls(); ShowCustomControls(); } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR)); } }
protected void Page_Load(object sender, EventArgs e) { try { _storageInID = Convert.ToInt32(Request.QueryString["StorageInID"]); _taskID = Convert.ToInt32(Request.QueryString["TaskStorageID"]); _QCbatch = Request.QueryString["QCBatch"]; control(); taskState(); initControl(_flag); this.gv = new SPGridView(); this.gv.AutoGenerateColumns = false; this.gv.RowDataBound += new GridViewRowEventHandler(gv_RowDataBound); BindGridView(); if (!IsPostBack) { ViewState["Temp"] = false; dataLoad(); } } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR)); } }
protected void Page_Load(object sender, EventArgs e) { try { this._userid = Convert.ToInt32(Request.QueryString["CurrentUserID"]); this._noticeid = Convert.ToInt32(Request.QueryString["NoticeID"]); InitializeCustomControls(); if (!Page.IsPostBack) { BindControl(); if (_noticeid != 0)//分支流程--修改Notice的情况 { BindDataToCustomControls(); } } } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR)); } }
protected void Page_Load(object sender, EventArgs e) { try { this._noticeid = Convert.ToInt32(Request.QueryString["NoticeID"]); _taskid = string.IsNullOrEmpty(Request.QueryString["TaskID"]) ? 0 : Convert.ToInt32(Request.QueryString["TaskID"]); if (NoticeIsInProcess()) { Response.Redirect(string.Format("ViewCommitOutDetails.aspx?NoticeID={0}", _noticeid), false); return; } strBackUrl = "ManageCommitOutNotice.aspx";//主流程--没有进入审批流程的情况 InitializeCustomControls(); BindDataToCustomControls(); ShowCustomControls(); } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR)); } }
protected void Page_Load(object sender, EventArgs e) { try { this._taskid = Convert.ToInt32(Request.QueryString["TaskID"]); using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { _receiptid = db.SrinQualifiedReceipt.SingleOrDefault(u => u.TaskID.Equals(_taskid)).SrinQualifiedReceiptID; if (db.TaskStorageIn.SingleOrDefault(u => u.TaskStorageID.Equals(_taskid)).TaskState.Equals("已完成")) { Response.Redirect(string.Format("RiAssetStorageDetails.aspx?TaskID={0}", _taskid), false);//分支流程--任务已完成的情况 return; } if (db.SrinWriteOffDetails.Count(u => u.SrinQualifiedReceiptID.Equals(_receiptid)) != 0)//分支流程--已经冲销过的情况 { Response.Redirect(string.Format("RiAssetModifyWriteoffDetails.aspx?TaskID={0}", _taskid), false); return; } } InitializeCustomControls(); BindDataToCustomControls(); ShowCustomControls(); } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR)); } }
protected void Page_Load(object sender, EventArgs e) { _stockID = Convert.ToInt32(Request.QueryString["StockID"]); if (!string.IsNullOrEmpty(Request.QueryString["Quantity"].ToString().Trim())) { _quantity = Convert.ToDecimal(Request.QueryString["Quantity"].ToString().Trim()); } _CurUnit = Request.QueryString["CurUnit"]; this.gv = new SPGridView(); this.gv.AutoGenerateColumns = false; try { //获取登录用户ID UserLoginId = reEmpId(SPContext.Current.Web.CurrentUser.LoginName); BindGridView(); LoadDate(); autoComplite(); initControls(); } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR)); } }
protected void Page_Load(object sender, EventArgs e) { try { _taskstorageid = Convert.ToInt32(Request.QueryString["TaskStorageID"]); using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { TaskStorageIn tsi = db.TaskStorageIn.SingleOrDefault(u => u.TaskStorageID == _taskstorageid); this._storageinid = tsi.StorageInID; this._batchname = tsi.QCBatch; } init(); BindGridView(); InitButton(); } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR)); } }
protected void Page_Load(object sender, EventArgs e) { try { _subdocid = Convert.ToInt32(Request.QueryString["SubDocID"]); strBackUrl = Request.QueryString["BackUrl"]; if (string.IsNullOrEmpty(strBackUrl)) { strBackUrl = string.Format("ManageSrinSubDetails.aspx?SubDocID={0}&IsValidate=false", _subdocid); } else { strBackUrl = HttpUtility.UrlDecode(strBackUrl); } using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { _projectid = db.SrinSubDoc.SingleOrDefault(u => u.SrinSubDocID == _subdocid).Project; } InitializeCustomControls(); BindDataToCustomControls(); ShowCustomControls(); } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR)); } }
void btnOK_Click(object sender, EventArgs e) { try { //物资组长审核完成,将任务置为'已完成' using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { if (soaa.AuditStatus.Equals("未通过")) { Response.Redirect(string.Format("CreateStorageOutTask.aspx?TaskID={0}&NoticeID={1}&TaskType=物资出库审核信息&Executor={2}", _taskid, _noticeid, executor), false); } else { Response.Redirect(string.Format("CreateStorageOutTask.aspx?TaskID={0}&NoticeID={1}&TaskType=主任审批", _taskid, _noticeid), false); } } } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_QUERYERROR)); } }
//private static string strUnFinishTaskType = "物资组清点,维修保养物资组长审核,生产组安排质检";//保存并发任务:在创建这些任务时,只创建任务而不结束当前任务 protected void Page_Load(object sender, EventArgs e) { try { //包括主流程和分支流程--流程初始任务发起时没有任务ID的情况 string strTaskID = Request.QueryString["TaskID"]; _taskid = string.IsNullOrEmpty(strTaskID) ? -1 : Convert.ToInt32(strTaskID); _executorid = Convert.ToInt32(Request.QueryString["Executor"]); _tasktype = Request.QueryString["TaskType"]; strFinishUrl = "../../default-old.aspx"; string strWorkID = Request.QueryString["WorkID"]; _workid = string.IsNullOrEmpty(strWorkID) ? -1 : Convert.ToInt32(strWorkID); this.InitControl(); } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_QUERYERROR)); } }
void btnOK_Click(object sender, EventArgs e) { try { using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { foreach (GridViewRow gvr in this.spgvMaterial.Rows) { SrinSubDetails ssd = db.SrinSubDetails.SingleOrDefault(u => u.SrinSubDetailsID == Convert.ToInt32(gvr.Cells[9].Text)); ssd.TotleGentaojian = Convert.ToDecimal(((TextBox)gvr.Cells[4].Controls[0]).Text.Trim()); ssd.TotleMetre = Convert.ToDecimal(((TextBox)gvr.Cells[5].Controls[0]).Text.Trim()); ssd.TotleTon = Convert.ToDecimal(((TextBox)gvr.Cells[6].Controls[0]).Text.Trim()); ssd.RetrieveCode = ((TextBox)gvr.Cells[7].Controls[0]).Text.Trim(); ssd.CreateTime = db.ExecuteQuery <DateTime>("select getdate()", new object[] { }).First(); ssd.Remark = ((TextBox)gvr.Cells[8].Controls[0]).Text.Trim(); db.SubmitChanges(); } } Response.Redirect(string.Format("RiDeliverySubDetailsMessage.aspx?TaskID={0}", _taskid), false); } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_UPDATEERROR)); } }
protected void Page_Load(object sender, EventArgs e) { try { _taskid = Convert.ToInt32(Request.QueryString["TaskID"]); using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { TaskStorageIn tsi = db.TaskStorageIn.SingleOrDefault(u => u.TaskStorageID == _taskid); _formid = tsi.StorageInID; if (tsi.TaskState.Equals("已完成")) { bfinished = true; } } InitializeCustomControls(); BindDataToCustomControls(); ShowCustomControls(); } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR)); } }
public void btnSave_Click(object sender, EventArgs e) { try { if (!string.IsNullOrEmpty(this.txtBillCode.Text)) { using (db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { CommitIn CI = new CommitIn(); CommitIn scode = db.CommitIn.SingleOrDefault(u => u.CommitInCode == this.txtBillCode.Text.Trim()); if (scode != null) { ClientScript.RegisterClientScriptBlock(typeof(string), "ShowMessage", "<script>alert('单据编码重复!')</script>"); return; } CI.CommitInCode = this.txtBillCode.Text.Trim(); CI.Remark = this.txtRemark.Text.Trim(); //var SevTime = db.ExecuteQuery<DateTime>("select getdate()", new object[] { }); CI.CreateTime = this.DateTimeStorageIn.SelectedDate; db.CommitIn.InsertOnSubmit(CI); db.SubmitChanges(); Response.Redirect("CommitInManage.aspx"); } } } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_INSERTERROR)); } }
void spgviewAuditControl_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { try { GridViewRow gvr = this.spgviewAuditControl.Rows[e.NewSelectedIndex]; Label lb = (Label)gvr.FindControl("LBItem"); int iAuditCount = Convert.ToInt32(ViewState["AuditCount"]); int iAuditFailedCount = Convert.ToInt32(ViewState["AuditFailedCount"]); switch (lb.Text) { case "未通过": lb.Text = "<font color = red>已通过</font>"; ViewState[e.NewSelectedIndex.ToString()] = "<font color = red>已通过</font>"; //所有项都是已通过时,将"全部通过审核"置为True iAuditCount++; iAuditFailedCount--; if (iAuditCount == this.spgviewAuditControl.Rows.Count) { SetAuditAllStatus(true); } break; case "<font color = red>已通过</font>": lb.Text = "未通过"; ViewState[e.NewSelectedIndex.ToString()] = "未通过"; iAuditCount--; iAuditFailedCount++; SetAuditAllStatus(false); break; case "待审核": lb.Text = "<font color = red>已通过</font>"; ViewState[e.NewSelectedIndex.ToString()] = "<font color = red>已通过</font>"; //所有项都是已通过时,将"全部通过审核"置为True iAuditCount++; if (iAuditCount == this.spgviewAuditControl.Rows.Count) { SetAuditAllStatus(true); } break; } ViewState["AuditCount"] = iAuditCount; ViewState["AuditFailedCount"] = iAuditFailedCount; int icount = iAuditCount + iAuditFailedCount; if (icount == this.spgviewAuditControl.Rows.Count) { btnSend.Enabled = true; } } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR)); } }
protected void Page_Load(object sender, EventArgs e) { try { if (Request.QueryString.Count >= 2) { if (string.IsNullOrEmpty(Request.QueryString["StorageInID"]) || string.IsNullOrEmpty(Request.QueryString["TaskStorageID"])) { Response.Redirect(strUrl); } } else { Response.Redirect(strUrl); } initControl(); LoadPageinfo(); //添加按钮到toolbar ToolBar tbarTop = (ToolBar)GetControltByMaster("tbarEmployee"); } catch (Exception ex) { MethodBase mb = MethodBase.GetCurrentMethod(); LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name)); ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR)); } }