public async Task PlayerPileClickedAsync(MilkRunPlayerItem thisPlayer, PileInfo pileData) { int newDeck = _model !.PlayerHand1 !.ObjectSelected(); if (newDeck == 0) { await UIPlatform.ShowMessageAsync("Sorry, must choose a card to play"); return; } if (SaveRoot !.CardsDrawn < 2) { await UIPlatform.ShowMessageAsync("Sorry, must draw the 2 cards first before playing"); return; } int index = thisPlayer.Id; if (CanMakeMove(index, newDeck, pileData.Pile, pileData.Milk) == false) { await UIPlatform.ShowMessageAsync("Illegal Move"); return; } if (BasicData !.MultiPlayer == true) { SendPlay thisSend = new SendPlay(); thisSend.Deck = newDeck; thisSend.Player = index; thisSend.Milk = pileData.Milk; thisSend.Pile = pileData.Pile; await Network !.SendAllAsync("play", thisSend); } await ProcessPlayAsync(index, newDeck, pileData.Pile, pileData.Milk); }
public void btnSave_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(this.txtName.Text) && !string.IsNullOrEmpty(this.txtCode.Text)) { using (db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { PileInfo pi = new PileInfo(); pi.PileName = this.txtName.Text.Trim(); PileInfo code = db.PileInfo.SingleOrDefault(u => u.PileCode == this.txtCode.Text.Trim()); if (code != null) { ClientScript.RegisterClientScriptBlock(typeof(string), "ShowMessage", "<script>alert('垛位代码重复!')</script>"); return; } pi.PileCode = this.txtCode.Text.Trim(); if (this.ddlStorage.SelectedIndex == 0) { ClientScript.RegisterClientScriptBlock(typeof(string), "ShowMessage", "<script>alert('请选择垛位所属仓库!')</script>"); return; } pi.StorageID = Convert.ToInt32(this.ddlStorage.SelectedValue); pi.PileSize = this.txtSize.Text.Trim(); pi.Remark = this.txtRemark.Text.Trim(); db.PileInfo.InsertOnSubmit(pi); db.SubmitChanges(); Response.Redirect("PileManage.aspx"); } } }
public RunFinder() { this.pileInfoArray = new PileInfo[MaxColumns]; for (int column = 0; column < MaxColumns; column++) { pileInfoArray[column] = new PileInfo(); pileInfoArray[column].RunInfoArray = new RunInfo[MaxRows]; } }
public int CountSuits(int column, int row) { PileInfo pileInfo = pileInfoArray[column]; if (row < pileInfo.RunUpAnySuitStart) { return(tableau.CountSuits(column, row)); } int result = pileInfo.RunInfoArray[row].Suits; Debug.Assert(result == tableau.CountSuits(column, row)); return(result); }
public int GetRunDown(int column, int row) { PileInfo pileInfo = pileInfoArray[column]; if (row < pileInfo.RunUpAnySuitStart) { return(tableau.GetRunDown(column, row)); } int result = pileInfo.RunInfoArray[row].EndRow - row; Debug.Assert(result == tableau.GetRunDown(column, row)); return(result); }
public int GetRunUp(int column, int row) { if (row == 0) { return(0); } PileInfo pileInfo = pileInfoArray[column]; if (row <= pileInfo.RunUpAnySuitStart) { return(tableau.GetRunUp(column, row)); } int result = row - pileInfo.RunInfoArray[row - 1].StartRow; Debug.Assert(result == tableau.GetRunUp(column, row)); return(result); }
public async Task <ListPileResponse> Get(string deckId, string pileName) { var deck = await repository.GetDeckAsync(deckId); var response = new ListPileResponse() { DeckId = deckId, Remaining = deck.Remaining }; var piles = new Dictionary <string, IPileInfo>(); foreach (var p in deck.Piles) { IPileInfo pileInfo; if (p.Name == pileName) { pileInfo = new PileInfo() { Remaining = p.Remaining }; foreach (var c in p.Cards) { var cardInfo = new CardInfo() { Code = c.Code, Suit = c.Suit, Value = c.Value }; ((PileInfo)pileInfo).Cards.Add(cardInfo); } } else { pileInfo = new ShortPileInfo() { Remaining = p.Remaining }; } piles.Add(p.Name, pileInfo); } response.Piles = piles; return(response); }
private void LoadData() { using (db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { int id = Convert.ToInt32(Request.QueryString["PileID"]); PileInfo PI = db.PileInfo.SingleOrDefault(a => a.PileID == id); if (PI != null) { this.txtName.Text = PI.PileName.ToString(); this.txtCode.Text = PI.PileCode.ToString(); this.ddlStorage.SelectedValue = PI.StorageID.ToString(); this.txtSize.Text = PI.PileSize.ToString(); this.txtRemark.Text = PI.Remark.ToString(); } else { ClientScript.RegisterClientScriptBlock(typeof(string), "ShowMessage", "<script>alert('记录不存在! ');</script>"); Response.Redirect("PileManage.aspx"); } } }
void btnOK_Click(object sender, EventArgs e) { if (CheckStringEmpty() != true) { ClientScript.RegisterClientScriptBlock(typeof(string), "ShowMessage", "<script>alert('请将选择的数据填写完整!')</script>"); return; } List <CheckBox> listString = GetCheckedID(); if (listString.Count == 0) { ClientScript.RegisterClientScriptBlock(typeof(string), "ShowMessage", "<script>alert('请选择调拨的记录!')</script>"); return; } using (db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { foreach (GridViewRow gvr in this.gv.Rows) { CheckBox chb = (CheckBox)gvr.Cells[0].Controls[0]; if (!chb.Checked) { continue; } //M roro var tbSelect = (TextBox)(gvr.Cells[4].Controls[0]); //var var tboxNums = (TextBox)(gvr.Cells[6].Controls[0]); var tboxNum = (TextBox)(gvr.Cells[8].Controls[0]); var tboxNumq = (TextBox)(gvr.Cells[10].Controls[0]); var ddlType = (DropDownList)(gvr.Cells[12].Controls[0]); var strT = tbSelect.Text.Split('|'); string strPileID = ""; if (strT.Length == 3) { strPileID = strT[2]; } PileInfo pi = db.PileInfo.SingleOrDefault(a => a.PileCode == strPileID); if (pi == null) { return; } StockTransferDetail sod = db.StockTransferDetail.SingleOrDefault(u => u.StockTransferID == Convert.ToInt32(Request.QueryString["StockTransferID"]) && u.StocksID == int.Parse(chb.ToolTip) && u.TargetPile == pi.PileID); //end M roro if (sod == null) { StockTransferDetail st = new StockTransferDetail(); st.DetailType = "移库任务"; decimal dcmT = 0; if (decimal.TryParse(tboxNums.Text, out dcmT)) { st.QuantityGentaojian = dcmT; } if (decimal.TryParse(tboxNum.Text, out dcmT)) { st.QuantityMetre = dcmT; } if (decimal.TryParse(tboxNumq.Text, out dcmT)) { st.QuantityTon = dcmT; } //st.Quantity //switch (ddlType.Text) //{ // case "根/套/件": // st.Quantity =decimal.Parse( st.QuantityGentaojian.ToString()); // break; // case "米": // st.Quantity = decimal.Parse(st.QuantityMetre.ToString()); // break; // case "吨": // st.Quantity = decimal.Parse(st.QuantityTon.ToString()); // break; //} st.StocksID = int.Parse(chb.ToolTip); st.StocksStatus = gvr.Cells[2].Text; st.StockTransferID = Convert.ToInt32(Request.QueryString["StockTransferID"]); st.TargetPile = pi.PileID; db.StockTransferDetail.InsertOnSubmit(st); } else { } db.SubmitChanges(); } Response.Redirect("StockTransferDetailsManage.aspx?StockTransferID=" + Request.QueryString["StockTransferID"]); } }
void btnSend_Click(object sender, EventArgs e) { try { using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { var tp = from a in db.CommitInDirector where a.CommitInID == Convert.ToInt32(Request.QueryString["StorageInID"]) select a; if (tp.ToArray().Length > 0) { ClientScript.RegisterClientScriptBlock(typeof(string), "ShowMessage", "<script>alert('不能重复插入记录!')</script>"); return; } } if (chbAgree.Checked == true) { using (db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { for (int i = 0; i < this.gv.Rows.Count; i++) { //写入流程中的主任审核表 CommitInDirector sid = new CommitInDirector(); sid.CommitInID = Convert.ToInt32(Request.QueryString["StorageInID"]); MaterialInfo mi = db.MaterialInfo.SingleOrDefault(u => u.MaterialCode == this.gv.Rows[i].Cells[2].Text.ToString()); sid.MaterialID = mi.MaterialID; sid.SpecificationModel = this.gv.Rows[i].Cells[3].Text.ToString(); sid.QuantityGentaojian = Convert.ToDecimal(this.gv.Rows[i].Cells[4].Text.ToString()); sid.QuantityMetre = Convert.ToDecimal(this.gv.Rows[i].Cells[5].Text.ToString()); sid.QuantityTon = Convert.ToDecimal(this.gv.Rows[i].Cells[6].Text.ToString()); sid.Quantity = Convert.ToDecimal(this.gv.Rows[i].Cells[7].Text.ToString()); sid.CurUnit = this.gv.Rows[i].Cells[8].Text.ToString(); sid.NumberQualified = 0; sid.InspectionReportNum = this.gv.Rows[i].Cells[12].Text.ToString(); sid.InspectionTime = Convert.ToDateTime(this.gv.Rows[i].Cells[13].Text.ToString()); sid.UnitPrice = Convert.ToDecimal(this.gv.Rows[i].Cells[9].Text.ToString()); sid.Amount = Convert.ToDecimal(this.gv.Rows[i].Cells[10].Text.ToString()); PileInfo pi = db.PileInfo.SingleOrDefault(u => u.PileCode == this.gv.Rows[i].Cells[15].Text.ToString()); sid.PileID = pi.PileID; sid.financeCode = this.gv.Rows[i].Cells[16].Text.ToString(); sid.StorageTime = Convert.ToDateTime(this.gv.Rows[i].Cells[17].Text.ToString()); //这里不唯一要出问题。 sid.SupplierID = Convert.ToInt32(this.gv.Rows[i].Cells[25].Text.ToString()); var temp = from a in db.CommitInAudited where a.CommitInID == Convert.ToInt32(Request.QueryString["StorageInID"]) select new { a.MaterialsManager, a.WarehouseWorker, a.MaterialAccounting }; var list = temp.ToList(); sid.MaterialsManager = list[i].MaterialsManager; sid.WarehouseWorker = list[i].WarehouseWorker; sid.MaterialAccounting = list[i].MaterialAccounting; sid.AuditStatus = this.gv.Rows[i].Cells[22].Text.ToString(); sid.AuditTime = Convert.ToDateTime(this.gv.Rows[i].Cells[23].Text.ToString()); sid.DirectorStatus = "已审批"; var SevTime = db.ExecuteQuery <DateTime>("select getdate()", new object[] { }); sid.DirectorTime = SevTime.First(); sid.Remark = this.gv.Rows[i].Cells[24].Text.ToString(); //sid.BatchIndex = this.gv.Rows[i].Cells[20].Text.ToString(); sid.Director = reEmpId(SPContext.Current.Web.CurrentUser.LoginName.ToString()); db.CommitInDirector.InsertOnSubmit(sid); //写入库存表 TableOfStocks tos = new TableOfStocks(); tos.StorageInID = Convert.ToInt32(Request.QueryString["StorageInID"]); tos.StorageInType = "委外入库"; tos.MaterialID = mi.MaterialID; tos.SpecificationModel = this.gv.Rows[i].Cells[3].Text.ToString(); tos.QuantityGentaojian = Convert.ToDecimal(this.gv.Rows[i].Cells[4].Text.ToString()); tos.QuantityMetre = Convert.ToDecimal(this.gv.Rows[i].Cells[5].Text.ToString()); tos.QuantityTon = Convert.ToDecimal(this.gv.Rows[i].Cells[6].Text.ToString()); tos.Quantity = Convert.ToDecimal(this.gv.Rows[i].Cells[7].Text.ToString()); tos.CurUnit = this.gv.Rows[i].Cells[8].Text.ToString(); tos.UnitPrice = sid.UnitPrice; tos.NumberQualified = 0; tos.PileID = pi.PileID; tos.financeCode = sid.financeCode; tos.StorageTime = sid.StorageTime; tos.SupplierID = sid.SupplierID; tos.MaterialsManager = list[i].MaterialsManager; tos.WarehouseWorker = list[i].WarehouseWorker; sid.Remark = sid.Remark; db.TableOfStocks.InsertOnSubmit(tos); db.SubmitChanges(); } //修改完成状态 if (!string.IsNullOrEmpty(Request.QueryString["TaskStorageID"])) { TaskStorageIn ts = db.TaskStorageIn.SingleOrDefault(u => u.TaskStorageID == Convert.ToInt32(Request.QueryString["TaskStorageID"])); if (ts != null) { ts.TaskState = "已完成"; ts.InspectState = "已审核"; ////修改代理任务完成状态 //ProxyDirector pd = db.ProxyDirector.SingleOrDefault(u => u.TaskID == Convert.ToInt32(Request.QueryString["TaskStorageID"]) && u.TaskProxy.TaskProxyType.TaskProxyTypeName == "正常入库"); //if (pd != null) //{ // TaskProxy tp = db.TaskProxy.SingleOrDefault(u => u.TaskProxyType.TaskProxyTypeName == "正常入库" && u.ProxyPrincipal == pd.TaskProxy.ProxyPrincipal && u.TaskDispose == "未完成"); // tp.TaskDispose = "完成"; //} } db.SubmitChanges(); } } Response.Redirect("DirectorPass.aspx?StorageInID=" + Request.QueryString["StorageInID"] + "&&TaskStorageID=" + Request.QueryString["TaskStorageID"] + ""); } else { using (db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { //任务信息 TaskStorageIn tsi = db.TaskStorageIn.SingleOrDefault(u => u.TaskStorageID == Convert.ToInt32(Request.QueryString["TaskStorageID"])); tsi.TaskState = "已完成"; tsi.InspectState = "已审核"; CommitIn si = db.CommitIn.SingleOrDefault(u => u.CommitInID == tsi.StorageInID); //发送新任务(回退任务) TaskStorageIn TSI = new TaskStorageIn(); TSI.TaskCreaterID = reEmpId(SPContext.Current.Web.CurrentUser.LoginName); TSI.TaskTargetID = tsi.TaskCreaterID; if (TSI.TaskTargetID == 0) { ClientScript.RegisterClientScriptBlock(typeof(string), "ShowMessage", "<script>alert('不存在质检用户,请同步AD账户 ')</script>"); return; } TSI.StorageInID = Convert.ToInt32(Request.QueryString["StorageInID"]); TSI.StorageInType = "委外入库"; TSI.TaskTitle = "主任审批任务:" + tsi.TaskTitle.ToString() + "(未通过)"; TSI.TaskState = "未完成"; TSI.TaskDispose = "未废弃"; TSI.TaskType = "材料会计审核"; TSI.InspectState = "驳回"; TSI.QCBatch = tsi.QCBatch; TSI.Remark = "交货通知单编号为:" + si.CommitInCode + "的物资审批不合格原因:" + this.txtOpinion.Text.Trim(); var SevTime = db.ExecuteQuery <DateTime>("select getdate()", new object[] { }); TSI.CreateTime = SevTime.First(); db.TaskStorageIn.InsertOnSubmit(TSI); 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)); } }
public void Find(Tableau tableau) { this.tableau = tableau; int n = tableau.NumberOfPiles; for (int column = 0; column < n; column++) { Pile pile = tableau[column]; PileInfo pileInfo = pileInfoArray[column]; int m = pile.Count; pileInfo.Count = m; pileInfo.RunInfoArray[m] = new RunInfo(m, m, 0); if (m == 0) { pileInfo.RunUpAnySuitStart = 0; pileInfo.RunUpAnySuitLength = 0; continue; } if (m == 1) { pileInfo.RunUpAnySuitStart = 0; pileInfo.RunUpAnySuitLength = 1; pileInfo.RunInfoArray[0] = new RunInfo(0, 1, 1); continue; } RunInfo[] runInfoArray = pileInfo.RunInfoArray; int startRow = m - 1; int endRow = m; int suits = 1; Card previousCard = pile[endRow - 1]; for (int currentRow = m - 2; currentRow >= 0; currentRow--) { Card currentCard = pile[currentRow]; if (!currentCard.IsTargetFor(previousCard)) { break; } if (currentCard.Suit == previousCard.Suit) { startRow = currentRow; } else { RunInfo runInfo = new RunInfo(startRow, endRow, suits); for (int row = startRow; row < endRow; row++) { runInfoArray[row] = runInfo; } startRow = currentRow; endRow = currentRow + 1; suits++; } previousCard = currentCard; } { RunInfo runInfo = new RunInfo(startRow, endRow, suits); for (int row = startRow; row < endRow; row++) { runInfoArray[row] = runInfo; } } pileInfo.RunUpAnySuitStart = startRow; pileInfo.RunUpAnySuitLength = m - startRow; } }
private string InsertData(Net.SourceForge.Koogra.Excel.Row row) { string strResult = ""; using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { //检查仓库 if (row.Cells[0] == null || row.Cells[1] == null || row.Cells[2] == null) { return("仓库信息不完整"); } //写入仓库信息 StorageInfo si; int empid = 0; //检查仓库是否存在 if (!db.StorageInfo.Any(a => a.StorageCode == row.Cells[0].Value.ToString())) { si = new StorageInfo(); //MT.MaterialMainTypeCode = si.StorageCode = row.Cells[0].Value.ToString(); si.StorageName = row.Cells[1].Value.ToString(); si.Remark = row.Cells[3] == null ? "" : row.Cells[3].Value.ToString(); empid = funGetUserIDbyAcc(row.Cells[2].Value.ToString()); if (empid == 0) { throw new Exception(); } si.EmpID = empid; db.StorageInfo.InsertOnSubmit(si); db.SubmitChanges(); } else { si = db.StorageInfo.SingleOrDefault(a => a.StorageCode == row.Cells[0].Value.ToString()); si.StorageCode = row.Cells[0].Value.ToString(); si.StorageName = row.Cells[1].Value.ToString(); si.Remark = row.Cells[3] == null ? "" : row.Cells[3].Value.ToString(); empid = funGetUserIDbyAcc(row.Cells[2].Value.ToString()); if (empid == 0) { throw new Exception(); } si.EmpID = empid; db.SubmitChanges(); } //*************************************************************************** //写入垛位信息 if (row.Cells[4] == null || row.Cells[5] == null) { return("垛位信息不完整"); } //写入垛位信息 PileInfo pi; //检查垛位是否存在 if (!db.PileInfo.Any(a => a.PileCode == row.Cells[4].Value.ToString())) { pi = new PileInfo(); //MT.MaterialMainTypeCode = pi.PileCode = row.Cells[4].Value.ToString(); pi.PileName = row.Cells[5].Value.ToString(); pi.PileSize = row.Cells[6] == null ? "" : row.Cells[6].Value.ToString(); pi.Remark = row.Cells[7] == null ? "" : row.Cells[7].Value.ToString(); pi.StorageID = si.StorageID; db.PileInfo.InsertOnSubmit(pi); db.SubmitChanges(); } else { pi = db.PileInfo.SingleOrDefault(a => a.PileCode == row.Cells[4].Value.ToString()); pi.PileCode = row.Cells[4].Value.ToString(); pi.PileName = row.Cells[5].Value.ToString(); pi.PileSize = row.Cells[6] == null ? "" : row.Cells[6].Value.ToString(); pi.Remark = row.Cells[7] == null ? "" : row.Cells[7].Value.ToString(); pi.StorageID = si.StorageID; db.SubmitChanges(); } } return(strResult); }
void btnOk_Click(object sender, EventArgs e) { try { //检查输入格式 if (CheckStringEmpty() != true) { ClientScript.RegisterClientScriptBlock(typeof(string), "ShowMessage", "<script>alert('请将数据填写完整,且合格数量只能是数字! ')</script>"); return; } //检查输入数据是否溢出 if (CheckOverFlow() != true) { ClientScript.RegisterClientScriptBlock(typeof(string), "ShowMessage", "<script>alert('合格数量不能超过质检前数量! ')</script>"); return; } using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { var tp = from a in db.CommitInQualified where a.CommitInID == Convert.ToInt32(Request.QueryString["StorageInID"]) select a; if (tp.ToArray().Length > 0) { ClientScript.RegisterClientScriptBlock(typeof(string), "ShowMessage", "<script>alert('不能重复插入记录! ')</script>"); return; } for (int i = 0; i < this.spgviewQualityControl.Rows.Count; i++) { CommitInQualified SIQ = new CommitInQualified(); SIQ.CommitInID = Convert.ToInt32(Request.QueryString["StorageInID"]); MaterialInfo mi = db.MaterialInfo.SingleOrDefault(u => u.MaterialCode == this.spgviewQualityControl.Rows[i].Cells[3].Text.ToString()); SIQ.MaterialID = mi.MaterialID; SIQ.SpecificationModel = this.spgviewQualityControl.Rows[i].Cells[4].Text.ToString(); SIQ.Quantity = Convert.ToDecimal(this.spgviewQualityControl.Rows[i].Cells[8].Text.ToString()); SIQ.CurUnit = this.spgviewQualityControl.Rows[i].Cells[9].Text.ToString(); TextBox gentaojian = (TextBox)(this.spgviewQualityControl.Rows[i].Cells[10].Controls[0]); SIQ.QuantityGentaojian = Convert.ToDecimal(gentaojian.Text.Trim()); TextBox metre = (TextBox)(this.spgviewQualityControl.Rows[i].Cells[11].Controls[0]); SIQ.QuantityMetre = Convert.ToDecimal(metre.Text.Trim()); TextBox ton = (TextBox)(this.spgviewQualityControl.Rows[i].Cells[12].Controls[0]); SIQ.QuantityTon = Convert.ToDecimal(ton.Text.Trim()); TextBox ti = (TextBox)(this.spgviewQualityControl.Rows[i].Cells[13].Controls[0]); SIQ.InspectionReportNum = ti.Text.Trim(); SIQ.NumberQualified = 0; SIQ.UnitPrice = Convert.ToDecimal(this.spgviewQualityControl.Rows[i].Cells[14].Text.ToString()); SIQ.Amount = Convert.ToDecimal(this.spgviewQualityControl.Rows[i].Cells[15].Text.ToString()); PileInfo pi = db.PileInfo.SingleOrDefault(u => u.PileCode == this.spgviewQualityControl.Rows[i].Cells[17].Text.ToString()); SIQ.PileID = pi.PileID; SIQ.financeCode = this.spgviewQualityControl.Rows[i].Cells[18].Text.ToString(); SIQ.StorageTime = Convert.ToDateTime(this.spgviewQualityControl.Rows[i].Cells[19].Text.ToString()); //这里不唯一要出问题。 SIQ.SupplierID = Convert.ToInt32(this.spgviewQualityControl.Rows[i].Cells[24].Text.ToString()); var temp = from a in db.CommitInDetailed where a.CommitInID == Convert.ToInt32(Request.QueryString["StorageInID"]) select new { a.MaterialsManager, a.WarehouseWorker }; var list = temp.ToList(); SIQ.MaterialsManager = list[i].MaterialsManager; SIQ.WarehouseWorker = list[i].WarehouseWorker; var SevTime = db.ExecuteQuery <DateTime>("select getdate()", new object[] { }); SIQ.InspectionTime = SevTime.First(); SIQ.Remark = this.spgviewQualityControl.Rows[i].Cells[23].Text.ToString(); db.CommitInQualified.InsertOnSubmit(SIQ); db.SubmitChanges(); } } Response.Redirect("QualifiedCommitIn.aspx?StorageInID=" + Request.QueryString["StorageInID"] + "&&TaskStorageID=" + Request.QueryString["TaskStorageID"] + " "); } 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)); } }