/// <summary>
 /// 数据加载
 /// </summary>
 public void Bind()
 {
     try
     {
         DataTable tableAssets = new DataTable();       //未开启SN的资产列表
         tableAssets.Columns.Add("CID");                //资产编号
         tableAssets.Columns.Add("NAME");               //资产名称
         tableAssets.Columns.Add("LOCID");              //   仓库/存储类型/库位
         tableAssets.Columns.Add("LOCNAME");            //   仓库名称/类型名称/库位名称
         tableAssets.Columns.Add("IMAGE");              //图片编号
         tableAssets.Columns.Add("QUANTITY");           //空闲数量
         tableAssets.Columns.Add("SELECTQTY");          //选择数量
         if (RowData.Count > 0)
         {
             foreach (ConsumablesOrderRow Row in RowData)
             {
                 ConQuant    conQuant             = autofacConfig.orderCommonService.GetUnUseConByCID(Row.CID, Row.WAREID, Row.STID, Row.SLID);
                 Consumables con                  = autofacConfig.consumablesService.GetConsById(Row.CID);
                 WHStorageLocationOutputDto WHLoc = autofacConfig.wareHouseService.GetSLByID(Row.WAREID, Row.STID, Row.SLID);
                 tableAssets.Rows.Add(Row.CID, con.NAME, Row.WAREID + "/" + Row.STID + "/" + Row.SLID, WHLoc.WARENAME + "/" + WHLoc.STNAME + "/" + WHLoc.SLNAME, con.IMAGE, conQuant.QUANTITY, Row.QTY);
             }
         }
         ListCons.DataSource = tableAssets;
         ListCons.DataBind();
     }
     catch (Exception ex)
     {
         Toast(ex.Message);
     }
 }
Exemple #2
0
        /// <summary>
        /// 数据绑定
        /// </summary>
        /// <param name="Name"></param>
        public void Bind(String Name)
        {
            try
            {
                DataTable tableAssets = new DataTable();       //未开启SN的资产列表
                tableAssets.Columns.Add("CHECK");              //资产编号
                tableAssets.Columns.Add("CID");                //耗材编号
                tableAssets.Columns.Add("NAME");               //耗材名称
                tableAssets.Columns.Add("IMAGE");              //图片编号
                tableAssets.Columns.Add("QUANTPURCHASED");     //预购数量
                tableAssets.Columns.Add("REALPRICE");          //预购价格

                List <Consumables> cons = autofacConfig.consumablesService.GetConsByName(Name);
                foreach (Consumables con in cons)
                {
                    if (Rows.Count > 0)
                    {
                        Boolean isAdd = false;
                        foreach (ConPurAndSaleCreateInputDto Row in Rows)
                        {
                            if (con.CID == Row.CID)
                            {
                                tableAssets.Rows.Add(true, Row.CID, con.NAME, Row.IMAGE, Row.QUANTPURCHASED, Row.REALPRICE);
                                isAdd = true;
                                break;
                            }
                        }
                        if (isAdd == false)
                        {
                            tableAssets.Rows.Add(false, con.CID, con.NAME, con.IMAGE, 0, 0);
                        }
                    }
                    else
                    {
                        tableAssets.Rows.Add(false, con.CID, con.NAME, con.IMAGE, 0, 0);
                    }
                }

                if (tableAssets.Rows.Count > 0)
                {
                    ListCons.DataSource = tableAssets;
                    ListCons.DataBind();
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }
Exemple #3
0
 /// <summary>
 /// 数据加载
 /// </summary>
 public void Bind()
 {
     try
     {
         if (Rows.Count > 0)
         {
             ListCons.DataSource = Rows;
             ListCons.DataBind();
         }
     }
     catch (Exception ex)
     {
         Toast(ex.Message);
     }
 }
Exemple #4
0
        /// <summary>
        /// 数据加载
        /// </summary>
        public void Bind()
        {
            try
            {
                foreach (ConsumablesOrderRow data in RowData)
                {
                    foreach (ListViewRow row in ListCons.Rows)
                    {
                        frmOrderCreateLayout Layout = row.Control as frmOrderCreateLayout;
                        string[]             LCData = Layout.lblLocation.BindDataValue.ToString().Split('/');
                        string cId = Layout.lblName.BindDataValue.ToString();
                        if (data.CID == cId && data.WAREID == LCData[0] &&
                            data.STID == LCData[1] && data.SLID == LCData[2])
                        {
                            data.QTY = (Decimal)Layout.numNumber.Value;
                        }
                    }
                }

                DataTable tableAssets = new DataTable();       //未开启SN的资产列表
                tableAssets.Columns.Add("CID");                //资产编号
                tableAssets.Columns.Add("NAME");               //资产名称
                tableAssets.Columns.Add("LOCID");              //   仓库/存储类型/库位
                tableAssets.Columns.Add("LOCNAME");            //   仓库名称/类型名称/库位名称
                tableAssets.Columns.Add("IMAGE");              //图片编号
                tableAssets.Columns.Add("QUANTITY");           //空闲数量
                tableAssets.Columns.Add("SELECTQTY");          //选择数量

                if (RowData.Count > 0)
                {
                    foreach (ConsumablesOrderRow Row in RowData)
                    {
                        ConQuant    conQuant             = autofacConfig.orderCommonService.GetUnUseConByCID(Row.CID, Row.WAREID, Row.STID, Row.SLID);
                        Consumables con                  = autofacConfig.consumablesService.GetConsById(Row.CID);
                        WHStorageLocationOutputDto WHLoc = autofacConfig.wareHouseService.GetSLByID(Row.WAREID, Row.STID, Row.SLID);
                        tableAssets.Rows.Add(Row.CID, con.NAME, Row.WAREID + "/" + Row.STID + "/" + Row.SLID, WHLoc.WARENAME + "/" + WHLoc.STNAME + "/" + WHLoc.SLNAME, con.IMAGE, conQuant.QUANTITY, Row.QTY);
                    }
                }
                ListCons.DataSource = tableAssets;
                ListCons.DataBind();
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }
        /// <summary>
        /// 数据绑定
        /// </summary>
        /// <param name="Name"></param>
        public void Bind(String Name)
        {
            try
            {
                DataTable tableAssets = new DataTable();       //未开启SN的资产列表
                tableAssets.Columns.Add("CHECK");              //资产编号
                tableAssets.Columns.Add("CID");                //耗材编号
                tableAssets.Columns.Add("NAME");               //资产名称
                tableAssets.Columns.Add("LOCID");              //   仓库/存储类型/库位
                tableAssets.Columns.Add("LOCNAME");            //   仓库名称/类型名称/库位名称
                tableAssets.Columns.Add("IMAGE");              //图片编号
                tableAssets.Columns.Add("QUANTITY");           //空闲数量
                tableAssets.Columns.Add("SELECTQTY");          //选择数量

                string[] LCData = LocInID.Split('/');
                List <ConQuantOutputDto> listAss = new List <ConQuantOutputDto>();
                if (String.IsNullOrEmpty(Name))     //查询所有耗材
                {
                    listAss = autofacConfig.orderCommonService.GetUnUseCon(LCData[0], LCData[1], LCData[2], null);
                }
                else
                {
                    List <Consumables> cons = autofacConfig.consumablesService.GetConsByName(Name);
                    foreach (Consumables con in cons)
                    {
                        List <ConQuantOutputDto> list = autofacConfig.orderCommonService.GetUnUseCon(LCData[0], LCData[1], LCData[2], con.CID);
                        listAss.AddRange(list);
                    }
                }
                foreach (ConQuantOutputDto Row in listAss)
                {
                    Consumables cons = autofacConfig.consumablesService.GetConsById(Row.CID);
                    WHStorageLocationOutputDto WHLoc = autofacConfig.wareHouseService.GetSLByID(Row.WAREID, Row.STID, Row.SLID);
                    if (RowData.Count > 0)
                    {
                        Boolean isAdd = false;
                        foreach (ConsumablesOrderRow HaveRow in RowData)
                        {
                            if (HaveRow.CID == Row.CID && HaveRow.WAREID == Row.WAREID &&
                                HaveRow.STID == Row.STID && HaveRow.SLID == Row.SLID)
                            {
                                tableAssets.Rows.Add(true, Row.CID, cons.NAME, Row.WAREID + "/" + Row.STID + "/" + Row.SLID, Row.WARENAME + "/" + Row.STNAME + "/" + Row.SLNAME, cons.IMAGE, Row.QUANTITY, HaveRow.QTY);
                                isAdd = true;
                                break;
                            }
                        }
                        if (isAdd == false)
                        {
                            tableAssets.Rows.Add(false, Row.CID, cons.NAME, Row.WAREID + "/" + Row.STID + "/" + Row.SLID, Row.WARENAME + "/" + Row.STNAME + "/" + Row.SLNAME, cons.IMAGE, Row.QUANTITY, 0);
                        }
                    }
                    else
                    {
                        tableAssets.Rows.Add(false, Row.CID, cons.NAME, Row.WAREID + "/" + Row.STID + "/" + Row.SLID, Row.WARENAME + "/" + Row.STNAME + "/" + Row.SLNAME, cons.IMAGE, Row.QUANTITY, 0);
                    }
                }

                if (tableAssets.Rows.Count > 0)
                {
                    ListCons.DataSource = tableAssets;
                    ListCons.DataBind();
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }