Esempio n. 1
0
        public ActionResult SaveMrrInfo(MrrInformation objMrr, List <MrrDetails> objMrrDetails)
        {
            var user = (User)Session["CurrentUser"];

            objMrr.UserId = user.EMPID;
            objMrr.TermId = user.TermID;
            var res = _mrrInfoRepository.SaveMrrInfo(objMrr, objMrrDetails);

            return(Json(res, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
        public MrrInformation SaveMrrInfo(MrrInformation objMrr, DataSet dsMrrDetails)
        {
            var res = new MrrInformation();
            var dt  = new DataTable();

            try
            {
                dt             = Insert_Update_MReceiveInfo("sp_insert_mreceive_info", "save_mreceive_info", objMrr, dsMrrDetails);
                res.SaveStatus = Operation.Success.ToString();
                res.RID        = Convert.ToInt32(dt.Rows[0]["RID"].ToString());
            }
            catch (Exception ex)
            {
                res.SaveStatus = ex.Message;
            }
            return(res);
        }
Esempio n. 3
0
 public DataTable Insert_Update_MReceiveInfo(string procedure, string callname, MrrInformation objMrr, DataSet rqdXmlv1 = null)
 {
     dbConn = new SqlConnection(ConnectionString);
     dbConn.Open();
     cmd             = new SqlCommand(procedure, dbConn);
     cmd.CommandType = CommandType.StoredProcedure;
     cmd.Parameters.Add(new SqlParameter("@call_name", callname));
     cmd.Parameters.Add("@dsxmlu1", SqlDbType.Xml).Value = (rqdXmlv1 == null ? null : rqdXmlv1.GetXml());
     cmd.Parameters.Add(new SqlParameter("@p_RID", objMrr.RID));
     cmd.Parameters.Add(new SqlParameter("@p_MrrDate", objMrr.MrrDate.ToString("dd-MMM-yyyy")));
     cmd.Parameters.Add(new SqlParameter("@p_SupplierId", objMrr.SupplierId));
     cmd.Parameters.Add(new SqlParameter("@p_LCNo", objMrr.LCNo));
     cmd.Parameters.Add(new SqlParameter("@p_LCDate", objMrr.LCDate.ToString("dd-MMM-yyyy")));
     cmd.Parameters.Add(new SqlParameter("@p_PINo", objMrr.PINo));
     cmd.Parameters.Add(new SqlParameter("@p_PIDate", objMrr.PIDate.ToString("dd-MMM-yyyy")));
     cmd.Parameters.Add(new SqlParameter("@p_InvNo", objMrr.InvNo));
     cmd.Parameters.Add(new SqlParameter("@p_InvDate", objMrr.InvDate.ToString("dd-MMM-yyyy")));
     cmd.Parameters.Add(new SqlParameter("@p_InvValue", objMrr.InvValue));
     cmd.Parameters.Add(new SqlParameter("@p_MRRNo", objMrr.MRRNo));
     cmd.Parameters.Add(new SqlParameter("@p_TruckNo", objMrr.TruckNo));
     cmd.Parameters.Add(new SqlParameter("@p_LCode", objMrr.LCode));
     cmd.Parameters.Add(new SqlParameter("@p_LName", objMrr.LName));
     cmd.Parameters.Add(new SqlParameter("@p_ImpTypeId", objMrr.ImpTypeId));
     cmd.Parameters.Add(new SqlParameter("@p_BLNo", objMrr.BLNo));
     cmd.Parameters.Add(new SqlParameter("@p_BLDate", objMrr.BLDate.ToString("dd-MMM-yyyy")));
     cmd.Parameters.Add(new SqlParameter("@p_BENo", objMrr.BENo));
     cmd.Parameters.Add(new SqlParameter("@p_BEDate", objMrr.BEDate.ToString("dd-MMM-yyyy")));
     cmd.Parameters.Add(new SqlParameter("@p_IPNo", objMrr.IPNo));
     cmd.Parameters.Add(new SqlParameter("@p_IPDate", objMrr.IPDate.ToString("dd-MMM-yyyy")));
     cmd.Parameters.Add(new SqlParameter("@p_CompanyId", objMrr.CompanyId));
     cmd.Parameters.Add(new SqlParameter("@p_UserName", objMrr.UserName));
     cmd.Parameters.Add(new SqlParameter("@p_EDate", DateTime.Now.ToString("dd-MMM-yyyy")));
     cmd.Parameters.Add(new SqlParameter("@p_Remarks", objMrr.Remarks));
     cmd.Parameters.Add(new SqlParameter("@p_PaymentId", objMrr.PaymentId));
     cmd.Parameters.Add(new SqlParameter("@p_Payment", objMrr.Payment));
     cmd.Parameters.Add(new SqlParameter("@p_PartialNo", objMrr.PartialNo));
     cmd.Parameters.Add(new SqlParameter("@p_ChallanNo", objMrr.ChallanNo));
     cmd.Parameters.Add(new SqlParameter("@p_ChallanDate", objMrr.ChallanDate.ToString("dd-MMM-yyyy")));
     cmd.Parameters.Add(new SqlParameter("@p_CertificateNo", objMrr.CertificateNo));
     cmd.Parameters.Add(new SqlParameter("@p_TrackDate", DateTime.Now.ToString("dd-MMM-yyyy")));
     cmd.Parameters.Add(new SqlParameter("@p_UserId", objMrr.UserId));
     cmd.Parameters.Add(new SqlParameter("@p_TermId", objMrr.TermId));
     da = new SqlDataAdapter(cmd);
     dt = new DataTable();
     da.Fill(dt);
     dbConn.Close();
     return(dt);
 }
Esempio n. 4
0
        public MrrInformation SaveMrrInfo(MrrInformation objMrr, List <MrrDetails> objMrrDetails)
        {
            var rv = new MrrInformation();

            //-------------------MRR Details information------------------------------------------
            var mrrDetailsDt = new DataTable();

            mrrDetailsDt.Columns.Add("ICODE");
            mrrDetailsDt.Columns.Add("RQNTY");
            mrrDetailsDt.Columns.Add("RRATE");
            mrrDetailsDt.Columns.Add("RVALUE");
            mrrDetailsDt.Columns.Add("UNIT");
            mrrDetailsDt.Columns.Add("CURCODE");
            mrrDetailsDt.Columns.Add("CRATE");
            mrrDetailsDt.Columns.Add("VTAKA");
            mrrDetailsDt.Columns.Add("LOTNO");
            mrrDetailsDt.Columns.Add("USERNAME");
            mrrDetailsDt.Columns.Add("PTGL");
            mrrDetailsDt.Columns.Add("EDATE");
            mrrDetailsDt.Columns.Add("REMARKS");
            mrrDetailsDt.Columns.Add("COMPLETE");
            mrrDetailsDt.Columns.Add("ISCODE");
            mrrDetailsDt.Columns.Add("ISPECIFICATION");
            mrrDetailsDt.Columns.Add("SLOT");
            mrrDetailsDt.Columns.Add("MID");
            mrrDetailsDt.Columns.Add("DEPARTMENTID");
            mrrDetailsDt.Columns.Add("SETNO");
            mrrDetailsDt.Columns.Add("YARNCODE");
            mrrDetailsDt.Columns.Add("CONEPERBAG");
            mrrDetailsDt.Columns.Add("CONEPERLENGTH");
            mrrDetailsDt.Columns.Add("TOTALNOOFBAG");
            mrrDetailsDt.Columns.Add("GCODE");
            mrrDetailsDt.Columns.Add("LCCOST");
            mrrDetailsDt.Columns.Add("WITHOUTCOSTRATE");
            mrrDetailsDt.Columns.Add("WITHOUTCOSTRVALUE");
            mrrDetailsDt.Columns.Add("SPRNO");
            mrrDetailsDt.Columns.Add("MFDDATE");
            mrrDetailsDt.Columns.Add("EXPDATE");
            mrrDetailsDt.Columns.Add("COTTONTYPEID");


            if (objMrrDetails != null && objMrrDetails.Count > 0)
            {
                foreach (var order in objMrrDetails)
                {
                    var row1 = mrrDetailsDt.NewRow();
                    row1["ICODE"]    = order.ICode;
                    row1["RQNTY"]    = order.RQnty;
                    row1["RRATE"]    = order.RRate;
                    row1["RVALUE"]   = order.RValue;
                    row1["UNIT"]     = order.Unit;
                    row1["CURCODE"]  = order.CurCode;
                    row1["CRATE"]    = order.CRate;
                    row1["VTAKA"]    = order.VTaka;
                    row1["LOTNO"]    = order.LotNo;
                    row1["USERNAME"] = objMrr.UserId;
                    row1["PTGL"]     = order.PTGL;//n
                    row1["EDATE"]    = DateTime.Now.ToString("dd-MMM-yyyy");
                    row1["REMARKS"]  = order.Remarks;
                    // row1["COMPLETE"] = order.Complete; //n
                    row1["ISCODE"]         = order.ISCode;         //n
                    row1["ISPECIFICATION"] = order.ISpecification; //n
                    // row1["SLOT"] = order.SLot;//n
                    row1["MID"]               = order.MID;         //n
                    row1["DEPARTMENTID"]      = order.DepartmentId;
                    row1["SETNO"]             = order.SetNo;
                    row1["YARNCODE"]          = order.YarnCode;
                    row1["CONEPERBAG"]        = order.ConePerBag;   //n
                    row1["CONEPERLENGTH"]     = order.ConePerLenght;
                    row1["TOTALNOOFBAG"]      = order.TotalNoOfBag; //n
                    row1["GCODE"]             = order.GCode;        //n
                    row1["LCCOST"]            = order.LCCost;       //n
                    row1["WITHOUTCOSTRATE"]   = order.WithOutCostRate;
                    row1["WITHOUTCOSTRVALUE"] = order.WithOutCostRValue;
                    row1["SPRNO"]             = order.SPRNo;//n
                    row1["MFDDATE"]           = Convert.ToDateTime(order.MfdDate).ToString("dd-MMM-yyyy");
                    row1["EXPDATE"]           = Convert.ToDateTime(order.ExpDate).ToString("dd-MMM-yyyy");
                    row1["COTTONTYPEID"]      = order.CottonTypeId;

                    mrrDetailsDt.Rows.Add(row1);
                }
            }
            mrrDetailsDt.TableName = "tblMrrDetails";
            DataSet dsMrrDetails = new DataSet("dsMrrDetails");

            dsMrrDetails.Tables.Add(mrrDetailsDt);

            return(_mrrInfoDataService.SaveMrrInfo(objMrr, dsMrrDetails));
        }