protected void Button200_Click(object sender, EventArgs e) { if (Button1.Text == "新增出库") { bool xx = new DAL.OutoutDAO().deleteOutById(Session["delete"].ToString()); if (xx) { ClientScript.RegisterClientScriptBlock(this.GetType(), "msg", "alert('删除成功!');", true); ideas.Style["display"] = "none"; rg.Refresh("select * from Outout order by num", "", GridView1); } else { ClientScript.RegisterClientScriptBlock(this.GetType(), "msg", "alert('删除失败!');", true); rg.Refresh("select * from Outout order by num", "", GridView1); } } }
protected void Button66_Click(object sender, EventArgs e) { Model.Outout add = new Model.Outout(); if (Button66.Text == "增加") { if (Image1.ImageUrl == "~/Image/对号.png" && Image2.ImageUrl == "~/Image/对号.png" && Image3.ImageUrl == "~/Image/对号.png" && Image4.ImageUrl == "~/Image/对号.png" && Image5.ImageUrl == "~/Image/对号.png" && Image6.ImageUrl == "~/Image/对号.png" && Image7.ImageUrl == "~/Image/对号.png" && Image8.ImageUrl == "~/Image/对号.png") { Warehouse.Tools.queryV qq = new Tools.queryV(); DAL.Query quu = new DAL.Query(); int n = quu.query("Outout"); add.Num = n + 1; add.OuID = TextBox11.Text; add.GoodsNum = TextBox12.Text; add.PositionNum = TextBox9.Text; add.OutAmount = Convert.ToDouble(TextBox2.Text); add.BatchNum = TextBox3.Text; add.Date = Convert.ToDateTime(TextBox4.Text); add.UserId = qu.query("select staffNum from Staff where staffName='" + TextBox5.Text + "'"); add.Remark = TextBox6.Text; bool xx = new DAL.OutoutDAO().addOut(add); if (xx) { Model.Amount update = new Model.Amount(); update.Amounts = Convert.ToDouble(Session["max"].ToString()) - Convert.ToDouble(add.OutAmount); double d = Convert.ToDouble(Session["V"].ToString()) / Convert.ToDouble(Session["max"].ToString()); update.V = (update.Amounts * d).ToString(); update.GoodsNum = TextBox12.Text; update.PositionNum = TextBox9.Text; update.Vp = d.ToString(); bool yy = new DAL.AmountDAO().update(update); if (yy) { double rest = Convert.ToDouble(qu.query("select Rest from Position where positionNum='" + TextBox9.Text + "'")); Model.Position Update = new Model.Position(); Update.Rest = (rest + d * add.OutAmount).ToString(); Update.PositionNum = TextBox9.Text; bool cc = new DAL.PositionDAO().update(Update); } ClientScript.RegisterClientScriptBlock(this.GetType(), "msg", "alert('添加成功!');window.location.href='出库登记.aspx'", true); } } } }