Example #1
0
        public RPDBatchActPackingDetailsCollec Get_By_BatchAct(long ID)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@RPDBatchActID", ID)
                };


                DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_RPDBatchActPackingDetails_BatchActID", paramList);

                RPDBatchActPackingDetailsCollec objCollec = new RPDBatchActPackingDetailsCollec();
                RPDBatchActPackingDetails       obj       = new RPDBatchActPackingDetails();

                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        obj.RPDPackDetails = Convert.ToInt64(dt.Rows[i]["RPDPackDetails"]);
                        obj.RPDBatchActID  = Convert.ToInt64(dt.Rows[i]["RPDBatchActID"]);
                        obj.MaterialCode   = Convert.ToString(dt.Rows[i]["MaterialCode"]);
                        obj.NoOfPackets    = Convert.ToInt64(dt.Rows[i]["NoOfPackets"]);
                        obj.PackSize       = Convert.ToDecimal(dt.Rows[i]["PackSize"]);

                        objCollec.Add(obj);
                    }
                }

                return(objCollec);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Example #2
0
        public long Add(RPDBatchActPackingDetails obj)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@RPDPackDetails", obj.RPDPackDetails),
                    new SqlParameter("@RPDBatchActID", obj.RPDBatchActID),
                    new SqlParameter("@MaterialCode", obj.MaterialCode),
                    new SqlParameter("@NoOfPackets", obj.NoOfPackets),
                    new SqlParameter("@PackSize", obj.PackSize),
                    new SqlParameter("@outParam", SqlDbType.Int)
                    {
                        Direction = ParameterDirection.Output
                    }
                };

                return(Execute.RunSP_Output(Connection, "SPADD_RPDBatchActPackingDetails_Update", paramList));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }