Exemplo n.º 1
0
        public List <VAppendStock> getSearchList(string beginDate, string endDate, int sideState)
        {
            string s = "";
            List <VAppendStock> list = new List <VAppendStock>();

            SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@beginDate", SqlDbType.NVarChar), new SqlParameter("@endDate", SqlDbType.NVarChar), new SqlParameter("@sideState", SqlDbType.Int) };
            parameters[0].Value = beginDate;
            parameters[1].Value = endDate;
            parameters[2].Value = sideState;
            SqlDataReader reader = SQLHelper.RunProcedure("p_AppendStock_getSearchList", parameters);

            while (reader.Read())
            {
                VAppendStock item = new VAppendStock();
                s = reader.GetValue(reader.GetOrdinal("AlreadyPay")).ToString();
                item.AlreadyPay    = float.Parse(s);
                item.AppendID      = reader.GetString(reader.GetOrdinal("AppendID"));
                item.CreateDate    = reader.GetString(reader.GetOrdinal("CreateDate"));
                item.RealName      = reader.GetString(reader.GetOrdinal("RealName"));
                item.Description   = reader.GetString(reader.GetOrdinal("Description"));
                item.AppendType    = reader.GetInt32(reader.GetOrdinal("AppendType"));
                item.HouseDetailID = reader.GetInt32(reader.GetOrdinal("HouseDetailID"));
                item.StoreHouseID  = reader.GetInt32(reader.GetOrdinal("StoreHouseID"));
                s = reader.GetValue(reader.GetOrdinal("TotalPrice")).ToString();
                item.TotalPrice  = float.Parse(s);
                item.SubareaName = reader.GetString(reader.GetOrdinal("SubareaName"));
                item.HouseName   = reader.GetString(reader.GetOrdinal("HouseName"));
                item.TradeDate   = reader.GetString(reader.GetOrdinal("TradeDate"));
                item.UserName    = reader.GetString(reader.GetOrdinal("UserName"));
                item.State       = reader.GetInt32(reader.GetOrdinal("State"));
                list.Add(item);
            }
            reader.Close();
            return(list);
        }
Exemplo n.º 2
0
        public VAppendStock getByID(string AppendID)
        {
            string       s     = "";
            VAppendStock stock = new VAppendStock();

            SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@AppendID", SqlDbType.NVarChar) };
            parameters[0].Value = AppendID;
            SqlDataReader reader = SQLHelper.RunProcedure("p_AppendStock_getByID", parameters);

            while (reader.Read())
            {
                s = reader.GetValue(reader.GetOrdinal("AlreadyPay")).ToString();
                stock.AlreadyPay    = float.Parse(s);
                stock.AppendID      = reader.GetString(reader.GetOrdinal("AppendID"));
                stock.CreateDate    = reader.GetString(reader.GetOrdinal("CreateDate"));
                stock.RealName      = reader.GetString(reader.GetOrdinal("RealName"));
                stock.Description   = reader.GetString(reader.GetOrdinal("Description"));
                stock.AppendType    = reader.GetInt32(reader.GetOrdinal("AppendType"));
                stock.HouseDetailID = reader.GetInt32(reader.GetOrdinal("HouseDetailID"));
                stock.StoreHouseID  = reader.GetInt32(reader.GetOrdinal("StoreHouseID"));
                s = reader.GetValue(reader.GetOrdinal("TotalPrice")).ToString();
                stock.TotalPrice  = float.Parse(s);
                stock.SubareaName = reader.GetString(reader.GetOrdinal("SubareaName"));
                stock.HouseName   = reader.GetString(reader.GetOrdinal("HouseName"));
                stock.TradeDate   = reader.GetString(reader.GetOrdinal("TradeDate"));
                stock.UserName    = reader.GetString(reader.GetOrdinal("UserName"));
            }
            reader.Close();
            return(stock);
        }
Exemplo n.º 3
0
    public void init()
    {
        string str0 = Request.QueryString["AppendID"].ToString();

        VAppendStock vb = Leyp.SQLServerDAL.Stock.Factory.getAppendStockDAL().getByID(str0);

        if (vb == null)
        {
            Response.Write("没有你要的数据");
            Response.End();
        }
        AppendID.Text    = vb.AppendID;
        CreateDate.Text  = vb.CreateDate;
        RealName.Text    = vb.RealName;
        HouseName.Text   = vb.HouseName + "----" + vb.SubareaName;
        TradeDate.Text   = vb.TradeDate;
        Description.Text = vb.Description;
        State.Text       = changString(vb.State.ToString());
        TotalPrice.Text  = vb.TotalPrice.ToString();
    }
Exemplo n.º 4
0
        public bool AuditingAppendStockOrder(string AppendID)
        {
            bool flag = false;

            try
            {
                VAppendStock stock             = new VAppendStock();
                List <VAppendStockDetail> list = new List <VAppendStockDetail>();
                ProductsStockDAL          kdal = new ProductsStockDAL();
                stock = new AppendStockDAL().getByID(AppendID);
                list  = new AppendStockDetailDAL().getListByAppendID(AppendID);
                for (int i = 0; i < list.Count; i++)
                {
                    ProductsStock     stock2;
                    AppendStockDetail detail = list[i];
                    if (kdal.isHaveEitity(stock.HouseDetailID, detail.ProductsID))
                    {
                        stock2 = new ProductsStock();
                        stock2.HouseDetailID = stock.HouseDetailID;
                        stock2.ProductsID    = detail.ProductsID;
                        stock2.Num           = detail.Quantity;
                        kdal.updateAddNum(stock2);
                    }
                    else
                    {
                        stock2 = new ProductsStock();
                        stock2.HouseDetailID = stock.HouseDetailID;
                        stock2.ProductsID    = detail.ProductsID;
                        stock2.Num           = detail.Quantity;
                        kdal.insertNewEitity(stock2);
                    }
                }
                flag = true;
            }
            catch
            {
            }
            return(flag);
        }