Exemplo n.º 1
0
        private void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            //更新
            try
            {
                string strProduceSerialNo = this.txtProduceSerialNo.Text;
                string strMakeSerialNo    = e.Item.Cells[0].Text;
                string strAdjustcount     = ((TextBox)e.Item.Cells[12].Controls[0]).Text;

                string strstcount = ((TextBox)e.Item.Cells[11].Controls[0]).Text;
                string strinvcode = e.Item.Cells[5].Text;

                string    strmakecount = e.Item.Cells[8].Text;
                string    strcount     = e.Item.Cells[13].Text;
                DataTable dtInv        = Application["tbInventory"] as DataTable;
                DataRow[] drInvs       = dtInv.Select("cnvcinvcode='" + strinvcode + "'");
                if (drInvs.Length == 0)
                {
                    throw new Exception("无此存货");
                }
                Entity.Inventory inv = new AMSApp.zhenghua.Entity.Inventory(drInvs[0]);
                if (!inv.cnbSelf && strAdjustcount != "0")
                {
                    throw new Exception("非自制存货,不能调整数量");
                }
//				if(Convert.ToDecimal(strmakecount)>Convert.ToDecimal(strcount)+Convert.ToDecimal(strAdjustcount)+Convert.ToDecimal(strstcount))
//					throw new Exception("计划生产数量不能大于库存领用量、调整生产数量、生产数量之和");
                OperLog ol = new OperLog();
                ol.cnvcOperID   = this.oper.strLoginID;
                ol.cnvcDeptID   = this.oper.strDeptID;
                ol.cnvcOperType = "调整数量";

                MakeDetail md = new MakeDetail();
                md.cnnMakeSerialNo = Convert.ToDecimal(strMakeSerialNo);
                md.cnnAdjustCount  = Convert.ToDecimal(strAdjustcount);
                md.cnnStCount      = Convert.ToDecimal(strstcount);
                md.cnvcInvCode     = strinvcode;
                ProduceFacade pf = new ProduceFacade();
                pf.UpdateMakeDetail(strProduceSerialNo, md, ol);
                this.Popup("更新调整数量及库存领用量成功");
                this.DataGrid1.EditItemIndex = -1;
                BindGrid();
            }
            catch (Exception ex)
            {
                this.Popup(ex.Message);
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // 在此处放置用户代码以初始化页面
            //btnPrint.Attributes.Add("onclick","return PrintDataGrid(document.all('DataGrid1'))");
            if (!this.IsPostBack)
            {
                if (Request["MakeSerialNo"] == null)
                {
                    Popup("无效链接");
                    return;
                }
                string     strDetailSql    = "";
                string     strMakeSerialNo = Request["MakeSerialNo"].ToString();
                string     strMakeType     = Request["MakeType"].ToString();
                string     strMakeLogSql   = "select * from tbMakeLog where cnnMakeSerialNo=" + strMakeSerialNo;
                string     strSql          = "select cnvcCode,cnvcname,'' as Speci,cnvcunit,cnnCount from tbMakeDetail where cnnMakeSerialNo=" + strMakeSerialNo;
                DataTable  dtDetailtmp     = Helper.Query(strSql);
                MakeDetail mDetail         = new MakeDetail(dtDetailtmp);
                string     strcode         = mDetail.cnvcCode.ToString();
                if (strcode.Length.ToString() != "5")
                {
                    strDetailSql = "select cnvcCode,cnvcname,'' as Speci,cnvcunit,cnnCount from tbMakeDetail where cnnMakeSerialNo=" + strMakeSerialNo;
                }
                else
                {
                    strDetailSql = "select a.cnvcCode,a.cnvcname,convert(varchar,b.cnnStatdardCount)+ b.cnvcUnit + '/'+cnvcStandardUnit as Speci,a.cnvcunit,a.cnnCount from tbMakeDetail a,tbMaterial b where a.cnvcCode=b.cnvcMaterialCode and cnnMakeSerialNo=" + strMakeSerialNo;
                }

                DataTable dtDetail  = Helper.Query(strDetailSql);
                DataTable dtMakeLog = Helper.Query(strMakeLogSql);
                MakeLog   mLog      = new MakeLog(dtMakeLog);
                if (mLog.cnvcMakeType == "0")
                {
                    this.DataGrid1.Caption    = mLog.cnvcMakeName + DateTime.Now.ToString("yyyy年MM月dd日") + "<br><div align='left'>生产流水:" + mLog.cnnProduceSerialNo.ToString() + "      制令流水:" + strMakeSerialNo + "</div>";
                    this.DataGrid1.DataSource = dtDetail;
                    this.DataGrid1.DataBind();
                }
                else
                {
                    this.Datagrid2.Caption    = mLog.cnvcMakeName + DateTime.Now.ToString("yyyy年MM月dd日") + "<br><div align='left'>生产流水:" + mLog.cnnProduceSerialNo.ToString() + "      制令流水:" + strMakeSerialNo + "</div>";
                    this.Datagrid2.DataSource = dtDetail;
                    this.Datagrid2.DataBind();
                }


                //Session["toExcel"] = dtDetail;
            }
        }
Exemplo n.º 3
0
        static void TestGetMakeDetail(Account account)
        {
            InsureAccount(account);

            Console.WriteLine("To GetMakeDetail, please input symbol, such as btcbitcny, bchbtc, eoseth ...");
            Console.Write("  symbol   = ");
            string symbol = Console.ReadLine();

            Console.Write("  order_id = ");
            long       order_id   = long.Parse(Console.ReadLine());
            MakeDetail makeDetail = Api.GetMakeDetail(account, symbol, order_id);

            if (makeDetail == null)
            {
                Console.WriteLine("GetMakeDetail Failed!");
                return;
            }

            Console.WriteLine("GetMakeDetail Succeed:  ({0} items)", makeDetail.items.Count);
            for (int i = 0; i < makeDetail.items.Count; i++)
            {
                MakeDetail.Item item = makeDetail.items[i];
                Console.WriteLine("  {0}.\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}",
                                  i + 1,
                                  item.id,
                                  item.volume,
                                  item.price,
                                  item.symbol,
                                  item.type,
                                  item.source,
                                  item.orderId,
                                  Math.Max(item.bid_user_id, item.ask_user_id),
                                  Math.Max(item.buy_fee, item.sell_fee),
                                  item.created);
            }
        }