示例#1
0
        public static List <Labouritems> FK_withoutJoin(string id, DAL DAL)
        {
            string q = " SELECT * FROM " + LABOURITEMS.LABOURITEMS_TBL + " \r\n";

            q += " WHERE " + LABOURITEMS.LABOURITEMS_TBL + "." + LABOUR.LABOUR_ID + "  = '" + id + "' \r\n";
            q += " ORDER BY  " + LABOURITEMS.LABOURITEMS_TBL + "." + LABOURITEMS.LABOURITEMS_ID + ";\r\n";

            List <Labouritems> list = new List <Labouritems>();

            using (IDataReader redr = new DAL().Listreader(q))
            {
                while (redr.Read() == true)
                {
                    Labouritems obj = new Labouritems()
                    {
                        Labouritems_id = redr[LABOURITEMS.LABOURITEMS_ID].ToString(),
                        Labour_id      = redr[LABOURITEMS.LABOUR_ID].ToString(),
                        Po_no          = redr[LABOURITEMS.PO_NO].ToString(),
                        Dc_no          = redr[LABOURITEMS.DC_NO].ToString(),
                        Product_id     = redr[LABOURITEMS.PRODUCT_ID].ToString(),
                        Sizes_id       = redr[LABOURITEMS.SIZES_ID].ToString(),
                        Qty            = redr[LABOURITEMS.QTY].ToString(),
                        Price          = ConvertTO.Decimal(redr[LABOURITEMS.PRICE].ToString()),
                        Cgst_percent   = ConvertTO.Decimal(redr[LABOURITEMS.CGST_PERCENT].ToString()),
                        Sgst_percent   = ConvertTO.Decimal(redr[LABOURITEMS.SGST_PERCENT].ToString()),
                        Igst_percent   = ConvertTO.Decimal(redr[LABOURITEMS.IGST_PERCENT].ToString()),
                        Refered_id     = redr[LABOURITEMS.REFERED_ID].ToString(),
                        Locked         = redr[LABOURITEMS.LOCKED].ToString(),
                    };

                    list.Add(obj);
                }
            }
            return(list);
        }
示例#2
0
        private static List <Labouritems> EntityList(string q)
        {
            List <Labouritems> list = new List <Labouritems>();

            using (IDataReader redr = new DAL().Listreader(q))
            {
                while (redr.Read() == true)
                {
                    Labouritems obj = new Labouritems()
                    {
                        Labouritems_id = redr[LABOURITEMS.LABOURITEMS_ID].ToString(),
                        Labour_id      = redr[LABOURITEMS.LABOUR_ID].ToString(),
                        Po_no          = redr[LABOURITEMS.PO_NO].ToString(),
                        Dc_no          = redr[LABOURITEMS.DC_NO].ToString(),
                        Product_id     = redr[PRODUCT.PRODUCT_NAME].ToString(),
                        Sizes_id       = redr[SIZES.SIZES_NAME].ToString(),
                        Qty            = redr[LABOURITEMS.QTY].ToString(),
                        Price          = ConvertTO.Decimal(redr[LABOURITEMS.PRICE].ToString()),
                        Cgst_percent   = ConvertTO.Decimal(redr[LABOURITEMS.CGST_PERCENT].ToString()),
                        Sgst_percent   = ConvertTO.Decimal(redr[LABOURITEMS.SGST_PERCENT].ToString()),
                        Igst_percent   = ConvertTO.Decimal(redr[LABOURITEMS.IGST_PERCENT].ToString()),
                        Refered_id     = redr[LABOURITEMS.REFERED_ID].ToString(),
                        Locked         = redr[LABOURITEMS.LOCKED].ToString(),
                    };

                    list.Add(obj);
                }
            }
            return(list);
        }
示例#3
0
        public static void InsertSub(Labouritems v, DAL dalsession)
        {
            string q = " INSERT INTO " + LABOURITEMS.LABOURITEMS_TBL + " ( ";

            q += " " + LABOURITEMS.LABOUR_ID + " \r\n ";
            q += "," + LABOURITEMS.PO_NO + " \r\n ";
            q += "," + LABOURITEMS.DC_NO + " \r\n ";
            q += "," + LABOURITEMS.PRODUCT_ID + " \r\n ";
            q += "," + LABOURITEMS.SIZES_ID + " \r\n ";
            q += "," + LABOURITEMS.QTY + " \r\n ";
            q += "," + LABOURITEMS.PRICE + " \r\n ";
            q += "," + LABOURITEMS.CGST_PERCENT + " \r\n ";
            q += "," + LABOURITEMS.SGST_PERCENT + " \r\n ";
            q += "," + LABOURITEMS.IGST_PERCENT + " \r\n ";
            q += "," + LABOURITEMS.REFERED_ID + " \r\n ";
            q += "," + LABOURITEMS.LOCKED + " \r\n ";
            q += " ) VALUES ( ";
            q += "  @" + LABOURITEMS.LABOUR_ID + "@ \r\n ";
            q += ", @" + LABOURITEMS.PO_NO + "@ \r\n ";
            q += ", @" + LABOURITEMS.DC_NO + "@ \r\n ";
            q += ", @" + LABOURITEMS.PRODUCT_ID + "@ \r\n ";
            q += ", @" + LABOURITEMS.SIZES_ID + "@ \r\n ";
            q += ", @" + LABOURITEMS.QTY + "@ \r\n ";
            q += ", @" + LABOURITEMS.PRICE + "@ \r\n ";
            q += ", @" + LABOURITEMS.CGST_PERCENT + "@ \r\n ";
            q += ", @" + LABOURITEMS.SGST_PERCENT + "@ \r\n ";
            q += ", @" + LABOURITEMS.IGST_PERCENT + "@ \r\n ";
            q += ", @" + LABOURITEMS.REFERED_ID + "@ \r\n ";
            q += ", @" + LABOURITEMS.LOCKED + "@ \r\n ";
            q += " ) \r\n ";
            q  = AttachParams(q, v);
            dalsession.Execute(q);
        }
示例#4
0
 private static string AttachParams(string q, Labouritems v)
 {
     q = q.Replace("@" + LABOURITEMS.LABOUR_ID + "@", "" + ConvertTO.SqlString(v.Labour_id) + "");
     q = q.Replace("@" + LABOURITEMS.PO_NO + "@", "" + ConvertTO.SqlString(v.Po_no) + "");
     q = q.Replace("@" + LABOURITEMS.DC_NO + "@", "" + ConvertTO.SqlString(v.Dc_no) + "");
     q = q.Replace("@" + LABOURITEMS.PRODUCT_ID + "@", "" + ConvertTO.SqlString(v.Product_id) + "");
     q = q.Replace("@" + LABOURITEMS.SIZES_ID + "@", "" + ConvertTO.SqlString(v.Sizes_id) + "");
     q = q.Replace("@" + LABOURITEMS.QTY + "@", "" + ConvertTO.SqlString(v.Qty) + "");
     q = q.Replace("@" + LABOURITEMS.PRICE + "@", "" + ConvertTO.SqlString((v.Price) + ""));
     q = q.Replace("@" + LABOURITEMS.CGST_PERCENT + "@", "" + ConvertTO.SqlString((v.Cgst_percent) + ""));
     q = q.Replace("@" + LABOURITEMS.SGST_PERCENT + "@", "" + ConvertTO.SqlString((v.Sgst_percent) + ""));
     q = q.Replace("@" + LABOURITEMS.IGST_PERCENT + "@", "" + ConvertTO.SqlString((v.Igst_percent) + ""));
     q = q.Replace("@" + LABOURITEMS.REFERED_ID + "@", "" + ConvertTO.SqlString(v.Refered_id) + "");
     q = q.Replace("@" + LABOURITEMS.LOCKED + "@", "" + ConvertTO.SqlString(v.Locked) + "");
     return(q);
 }
示例#5
0
 public static void Insert(List <Labouritems> list, DAL dalsession)
 {
     for (int i = 0; i < list.Count; i++)
     {
         Labouritems obj = new Labouritems()
         {
             Labour_id    = list[i].Labour_id,
             Po_no        = list[i].Po_no,
             Dc_no        = list[i].Dc_no,
             Product_id   = list[i].Product_id,
             Sizes_id     = list[i].Sizes_id,
             Qty          = list[i].Qty,
             Price        = list[i].Price,
             Cgst_percent = list[i].Cgst_percent,
             Sgst_percent = list[i].Sgst_percent,
             Igst_percent = list[i].Igst_percent,
             Refered_id   = list[i].Refered_id,
             Locked       = list[i].Locked
         };
         InsertSub(obj, dalsession);
     }
 }