}  //提供数据的方法

    public dotNetFlexGrid.DataHandlerResult DotNetFlexGrid1DataHandler(dotNetFlexGrid.DataHandlerParams p)
    {
        dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult();
        result.page  = p.page; //设定当前返回的页号
        result.total = 100;    //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际

        WarehouseInvenModel rm = new WarehouseInvenModel();



        //string Type = "";
        //if (p.extParam.ContainsKey("Type"))
        //{
        //    Type = p.extParam["Type"];
        //}
        string STime = "";

        if (p.extParam.ContainsKey("STime"))
        {
            STime = p.extParam["STime"];
        }
        string ETime = "";

        if (p.extParam.ContainsKey("ETime"))
        {
            ETime = p.extParam["ETime"];
        }
        int pageSize = p.rp;

        result.table = rm.finTransferInfor(STime, ETime);

        return(result);
    }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            WarehousepharmacyModel hm  = new WarehousepharmacyModel();
            SqlDataReader          sdr = hm.findWarehouseInfo();
            if (sdr != null)
            {
                while (sdr.Read())
                {
                    this.Warehouse1.Items.Add(new ListItem(sdr["WName"].ToString()));
                }
            }
        }

        if (Request.QueryString["id"] != null)
        {
            int id = Convert.ToInt16(Request.QueryString["id"]);
            idnum1.Value = Request.QueryString["id"].ToString();
            WarehouseInvenModel rm = new WarehouseInvenModel();
            DataTable           dt = rm.findWarehouseInvenInfo(id);

            Warehouse1.Value       = dt.Rows[0]["Warehouse"].ToString();
            InventoryPer.Value     = dt.Rows[0]["InventoryPer"].ToString();
            ActualCapacity.Value   = dt.Rows[0]["ActualCapacity"].ToString();
            InventoryStatus.Value  = dt.Rows[0]["InventoryStatus"].ToString();
            StorageCondition.Value = dt.Rows[0]["StorageCondition"].ToString();
            Rmarkes.Value          = dt.Rows[0]["remark"].ToString();
        }
    }
    protected void Exportform_Click(object sender, EventArgs e)
    {
        //string type = Type.Value;
        string sTime            = STime.Value;
        string eTime            = ETime.Value;
        WarehouseInvenModel hm1 = new WarehouseInvenModel();

        // DataBaseLayer db = new DataBaseLayer();
        //    string str = "select * from lossiInfor where type ='" + type + "'";
        DataTable dt = hm1.finTransferInfor(sTime, eTime);

        System.DateTime currentTime = new System.DateTime();
        currentTime = System.DateTime.Now;
        string now = currentTime.ToString("yyyyMMdd");

        CreateExcel(dt, "application/ms-excel", "库房报单查询" + now);
    }
Exemple #4
0
    public static string WarehouseInvenUpdateInfo(int id, string Warehouse, string InventoryPer, string ActualCapacity, string InventoryStatus, string StorageCondition, string remark)
    {
        WarehouseInvenModel winfo = new WarehouseInvenModel();
        int result = winfo.updateWarehouseInvenInfo(id, Warehouse, InventoryPer, ActualCapacity, InventoryStatus, StorageCondition, remark);

        string str = null;

        if (result == 0)
        {
            str = "0";
        }
        else
        {
            str = "1";
        }
        return(str);
    }
Exemple #5
0
    protected void ExportHouse_Click(object sender, EventArgs e)
    {
        string sTime       = STime.Value;
        string eTime       = ETime.Value;
        string Warehousing = Warehouse.Value;
        string DrugName    = drugname123.Value;


        WarehouseInvenModel rm = new WarehouseInvenModel();

        DataTable dt = rm.finWarehouseInvenInfor(Warehousing, sTime, eTime, DrugName);

        System.DateTime currentTime = new System.DateTime();
        currentTime = System.DateTime.Now;
        string now = currentTime.ToString("yyyyMMdd");

        CreateExcel(dt, "application/ms-excel", "库房库存盘点" + now);
    }
Exemple #6
0
    public static string addWarehouseInvenInfo(string fromid, string drugnum, string InventoryPer, string ActualCapacity, string InventoryStatus, string StorageCondition, string Rmarkes)
    {
        string result = "";

        WarehouseInvenModel wr = new WarehouseInvenModel();

        int sdr = wr.AddWarehouseInven(fromid, drugnum, InventoryPer, ActualCapacity, InventoryStatus, StorageCondition, Rmarkes);

        if (sdr == 0)
        {
            result = "0";
        }
        else
        {
            result = "1";
        }

        return(result);
    }
Exemple #7
0
    }  //提供数据的方法

    public dotNetFlexGrid.DataHandlerResult DotNetFlexGrid1DataHandler(dotNetFlexGrid.DataHandlerParams p)
    {
        dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult();
        result.page  = p.page; //设定当前返回的页号
        result.total = 100;    //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际

        WarehouseInvenModel rm = new WarehouseInvenModel();



        string Warehouse = "";

        if (p.extParam.ContainsKey("Warehouse"))
        {
            Warehouse = p.extParam["Warehouse"];
        }
        string STime = "";

        if (p.extParam.ContainsKey("STime"))
        {
            STime = p.extParam["STime"];
        }
        string ETime = "";

        if (p.extParam.ContainsKey("ETime"))
        {
            ETime = p.extParam["ETime"];
        }

        string drugname = "";

        if (p.extParam.ContainsKey("drugname"))
        {
            drugname = p.extParam["drugname"];
        }

        int pageSize = p.rp;

        result.table = rm.finWarehouseInvenInfor(Warehouse, STime, ETime, drugname);
        dotNetFlexGrid.FieldFormatorHandle proc = delegate(DataRow dr)
        {
            int a = Convert.ToInt32(dr["InventoryStatus"].ToString());
            if (a == 0)
            {
                return("安全");
            }
            else
            {
                return("不安全");
            }
        };
        result.FieldFormator.Register("InventoryStatus", proc);
        dotNetFlexGrid.FieldFormatorHandle proc2 = delegate(DataRow dr)
        {
            int a = Convert.ToInt32(dr["StorageCondition"].ToString());
            if (a == 0)
            {
                return("合格");
            }
            else
            {
                return("不合格");
            }
        };
        result.FieldFormator.Register("StorageCondition", proc2);
        result.FieldFormator.Register("InventoryStatus", proc);



        /*  dotNetFlexGrid.FieldFormatorHandle proc4 = delegate(DataRow dr)
         *   {
         *      int iamount=0;
         *        int famount = 0;
         *        if (dr["iamount"].ToString() == "")
         *        {
         *            iamount = 0;
         *        }
         *        else
         *        {
         *            iamount = Convert.ToInt32(dr["iamount"].ToString());
         *        }
         *
         *        if (dr["famount"].ToString() == "")
         *        {
         *            famount=0;
         *        }
         *        else
         *        {
         *
         *           famount = Convert.ToInt32(dr["famount"].ToString());
         *        }
         *
         *       int c = iamount - famount;
         *       if (c < 0)
         *       {
         *           c = -c;
         *       }
         *
         *       string cstr = c.ToString();
         *
         *       return cstr;
         *
         *   };
         *   result.FieldFormator.Register("kucun", proc4);
         *
         *
         */


        /*  dotNetFlexGrid.FieldFormatorHandle proc5 = delegate(DataRow dr)
         * {
         *
         *    if (dr["iamount"].ToString() == "")
         *    {
         *        return "0";
         *    }
         *    else
         *    {
         *        return  dr["iamount"].ToString();
         *    }
         *
         * };
         * result.FieldFormator.Register("iamount", proc5);
         *
         *
         * dotNetFlexGrid.FieldFormatorHandle proc6 = delegate(DataRow dr)
         * {
         *
         *    if (dr["famount"].ToString() == "")
         *    {
         *        return "0";
         *    }
         *    else
         *    {
         *        return dr["famount"].ToString();
         *    }
         *
         * };
         * result.FieldFormator.Register("famount", proc6);
         */

        dotNetFlexGrid.FieldFormatorHandle proc3 = delegate(DataRow dr)
        {
            int a = Convert.ToInt32(dr["kucun"].ToString()) - Convert.ToInt32(dr["ActualCapacity"].ToString());
            if (a < 0)
            {
                a = -a;
            }
            return(a.ToString());
        };
        result.FieldFormator.Register("chazhi", proc3);


        return(result);
    }