Esempio n. 1
0
        private static List <Outwarditems> EntityList(string q)
        {
            List <Outwarditems> list = new List <Outwarditems>();

            using (IDataReader redr = new DAL().Listreader(q))
            {
                while (redr.Read() == true)
                {
                    Outwarditems obj = new  Outwarditems()
                    {
                        Outwarditems_id = redr[OUTWARDITEMS.OUTWARDITEMS_ID].ToString(),
                        Outward_id      = redr[OUTWARDITEMS.OUTWARD_ID].ToString(),
                        Style_id        = redr[STYLE.STYLE_NO].ToString(),
                        Article_id      = redr[ARTICLE.ARTICLE_NO].ToString(),
                        Product_id      = redr[PRODUCT.PRODUCT_NAME].ToString(),
                        Colours_id      = redr[COLOURS.COLOURS_NAME].ToString(),
                        Sizes_id        = redr[SIZES.SIZES_NAME].ToString(),
                        Qty             = redr[OUTWARDITEMS.QTY].ToString(),
                        Locked          = redr[OUTWARDITEMS.LOCKED].ToString(),
                    };

                    list.Add(obj);
                }
            }
            return(list);
        }
Esempio n. 2
0
        public static Print_ItemsList GetData(string p_id)
        {
            Print_ItemsList list = new Print_ItemsList();
            //
            List <Outwarditems> inv_item_list = COutwarditems_exten.FKId(p_id);

            for (int r = 0; r <= inv_item_list.Count - 1; r++)
            {
                Outwarditems row = new Outwarditems
                {
                    Outwarditems_id = inv_item_list[r].Outwarditems_id,

                    Outward_id = inv_item_list[r].Outward_id,

                    Slno = (r + 1).ToString(),

                    Style_id = Checks.RemoveEscape(inv_item_list[r].Style_id),

                    Article_id = Checks.RemoveEscape(inv_item_list[r].Article_id),

                    Product_id = Checks.RemoveEscape(inv_item_list[r].Product_id),

                    Sizes_id = inv_item_list[r].Sizes_id,

                    Colours_id = inv_item_list[r].Colours_id,

                    Qty = inv_item_list[r].Qty
                };

                list.Add(row);
            }

            return(list);
        }
Esempio n. 3
0
        public static void InsertSub(Outwarditems v, DAL dalsession)
        {
            string q = " INSERT INTO " + OUTWARDITEMS.OUTWARDITEMS_TBL + " ( ";

            q += " " + OUTWARDITEMS.OUTWARD_ID + " \r\n ";
            q += "," + OUTWARDITEMS.STYLE_ID + " \r\n ";
            q += "," + OUTWARDITEMS.ARTICLE_ID + " \r\n ";
            q += "," + OUTWARDITEMS.PRODUCT_ID + " \r\n ";
            q += "," + OUTWARDITEMS.SIZES_ID + " \r\n ";
            q += "," + OUTWARDITEMS.COLOURS_ID + " \r\n ";
            q += "," + OUTWARDITEMS.QTY + " \r\n ";
            q += "," + OUTWARDITEMS.LOCKED + " \r\n ";
            q += " ) VALUES ( ";
            q += "  @" + OUTWARDITEMS.OUTWARD_ID + "@ \r\n ";
            q += ", @" + OUTWARDITEMS.STYLE_ID + "@ \r\n ";
            q += ", @" + OUTWARDITEMS.ARTICLE_ID + "@ \r\n ";
            q += ", @" + OUTWARDITEMS.PRODUCT_ID + "@ \r\n ";
            q += ", @" + OUTWARDITEMS.SIZES_ID + "@ \r\n ";
            q += ", @" + OUTWARDITEMS.COLOURS_ID + "@ \r\n ";
            q += ", @" + OUTWARDITEMS.QTY + "@ \r\n ";
            q += ", @" + OUTWARDITEMS.LOCKED + "@ \r\n ";
            q += " ) \r\n ";
            q  = AttachParams(q, v);
            dalsession.Execute(q);
        }
Esempio n. 4
0
 private static string AttachParams(string q, Outwarditems v)
 {
     q = q.Replace("@" + OUTWARDITEMS.OUTWARD_ID + "@", "" + ConvertTO.SqlString(v.Outward_id) + "");
     q = q.Replace("@" + OUTWARDITEMS.STYLE_ID + "@", "" + ConvertTO.SqlString(v.Style_id) + "");
     q = q.Replace("@" + OUTWARDITEMS.ARTICLE_ID + "@", "" + ConvertTO.SqlString(v.Article_id) + "");
     q = q.Replace("@" + OUTWARDITEMS.PRODUCT_ID + "@", "" + ConvertTO.SqlString(v.Product_id) + "");
     q = q.Replace("@" + OUTWARDITEMS.SIZES_ID + "@", "" + ConvertTO.SqlString(v.Sizes_id) + "");
     q = q.Replace("@" + OUTWARDITEMS.QTY + "@", "" + ConvertTO.SqlString(v.Qty) + "");
     q = q.Replace("@" + OUTWARDITEMS.COLOURS_ID + "@", "" + ConvertTO.SqlString(v.Colours_id) + "");
     q = q.Replace("@" + OUTWARDITEMS.LOCKED + "@", "" + ConvertTO.SqlString(v.Locked) + "");
     return(q);
 }
Esempio n. 5
0
 public static void Insert(List <Outwarditems> list, DAL dalsession)
 {
     for (int i = 0; i < list.Count; i++)
     {
         Outwarditems obj = new Outwarditems()
         {
             Outward_id = list[i].Outward_id,
             Style_id   = list[i].Style_id,
             Article_id = list[i].Article_id,
             Product_id = list[i].Product_id,
             Sizes_id   = list[i].Sizes_id,
             Colours_id = list[i].Colours_id,
             Qty        = list[i].Qty,
             Locked     = list[i].Locked
         };
         InsertSub(obj, dalsession);
     }
 }
Esempio n. 6
0
        private List <Outwarditems> Collectitems(string vId)
        {
            List <Outwarditems> list = new List <Outwarditems>();

            for (int r = 0; r < editgrid.RowCount; r++)
            {
                Outwarditems obj = new Outwarditems();

                if (
                    (editgrid[OUTWARDITEMS.PRODUCT_ID, r].Value + "") == "" ||
                    (editgrid[OUTWARDITEMS.COLOURS_ID, r].Value + "") == "" ||
                    (editgrid[OUTWARDITEMS.SIZES_ID, r].Value + "") == "" ||
                    (editgrid[OUTWARDITEMS.QTY, r].Value + "") == ""
                    )
                {
                    //==LEAVE IT(the empty row).
                }
                else
                {
                    obj.Outwarditems_id = "";
                    obj.Outward_id      = vId;
                    obj.Style_id        = CStyle_exten.GetId_Name(Checks.Escape(editgrid[OUTWARDITEMS.STYLE_ID, r].Value + ""));
                    obj.Article_id      = CArticle_exten.GetId_Name(Checks.Escape(editgrid[OUTWARDITEMS.ARTICLE_ID, r].Value + ""));
                    obj.Product_id      = CProduct_exten.GetId_Name(Checks.Escape(editgrid[OUTWARDITEMS.PRODUCT_ID, r].Value + ""));
                    obj.Sizes_id        = CSizes_exten.GetId_Name(editgrid[OUTWARDITEMS.SIZES_ID, r].Value + "");
                    obj.Colours_id      = CColours_exten.GetId_Name(editgrid[OUTWARDITEMS.COLOURS_ID, r].Value + "");
                    obj.Qty             = (editgrid[OUTWARDITEMS.QTY, r].Value + "");
                    //obj.Refered_id = "";
                    obj.Locked = Core.Unlocked;

                    list.Add(obj);
                }
            }

            if (list.Count != 0)
            {
                return(list);
            }

            return(null);
        }