Esempio n. 1
0
        public List <RetVendorDetails> GetVendorDetail(string xmlDoc, string spName, ref string errorMessage)
        {
            List <RetVendorDetails> listDeatil;

            try
            {
                listDeatil = new List <RetVendorDetails>();
                DataTaskManager dt = new DataTaskManager();

                using (DataTaskManager dtManager = new DataTaskManager())
                {
                    DBParameterList dbParam = new DBParameterList();

                    dbParam.Add(new DBParameter(Common.PARAM_DATA, xmlDoc, DbType.String));
                    dbParam.Add(new DBParameter(Common.PARAM_OUTPUT, string.Empty, DbType.String,
                                                ParameterDirection.Output, Common.PARAM_OUTPUT_LENGTH));

                    using (DataSet ds = dtManager.ExecuteDataSet(spName, dbParam))
                    {
                        errorMessage = dbParam[Common.PARAM_OUTPUT].Value.ToString();

                        if (errorMessage.Length == 0 && ds != null && ds.Tables.Count > 0) //No dbError
                        {
                            foreach (DataRow drDeatils in ds.Tables[0].Rows)
                            {
                                RetVendorDetails obj = new RetVendorDetails();

                                obj.BatchNo         = Convert.ToString(drDeatils["BatchNo"]);
                                obj.ItemDescription = Convert.ToString(drDeatils["ItemName"]);
                                obj.ItemCode        = Convert.ToString(drDeatils["ItemCode"]);
                                obj.PODate          = Convert.ToDateTime(drDeatils["PODate"]).ToString(Common.DATE_TIME_FORMAT);
                                //obj.DisplayPODate = Convert.ToDateTime(drDeatils["PODate"]).ToString(Common.DTP_DATE_FORMAT);
                                obj.ItemId       = Convert.ToInt32(drDeatils["ItemId"]);
                                obj.POQty        = Convert.ToDouble(drDeatils["POQty"]);
                                obj.ReturnQty    = Convert.ToInt32(drDeatils["ReturnQty"]);
                                obj.PONumber     = Convert.ToString(drDeatils["PONumber"]);
                                obj.ReturnReason = Convert.ToString(drDeatils["ReturnReason"]);
                                obj.Bucket       = Convert.ToString(drDeatils["Bucket"]);
                                obj.BucketId     = Convert.ToInt32(drDeatils["BucketId"]);
                                obj.AvailableQty = Convert.ToInt32(drDeatils["AvailableQty"]);
                                obj.POAmount     = Convert.ToDouble(drDeatils["POAmount"]);

                                obj.GRNInvoiceNumber   = drDeatils["GRNInvoiceNo"].ToString();
                                obj.GRNReceivedQty     = Convert.ToDouble(drDeatils["GRNReceivedQty"]);
                                obj.GRNInvoiceType     = Convert.ToInt32(drDeatils["GRNInvoiceType"]);
                                obj.LineTaxAmount      = Convert.ToDecimal(drDeatils["LineTaxAmount"]);
                                obj.ManufactureBatchNo = drDeatils["ManufactureBatchNo"].ToString();

                                listDeatil.Add(obj);
                            }
                        }
                    }
                }
                return(listDeatil);
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 2
0
        public DataTable GetPODetails(RetVendorDetails objDetails, string xmlDoc, string spName, ref string errorMessage)
        {
            try
            {
                DataTable       dtVendor = new DataTable();
                DataTaskManager dt       = new DataTaskManager();

                using (DataTaskManager dtManager = new DataTaskManager())
                {
                    DBParameterList dbParam = new DBParameterList();

                    dbParam.Add(new DBParameter(Common.PARAM_DATA, xmlDoc, DbType.String));
                    dbParam.Add(new DBParameter(Common.PARAM_OUTPUT, string.Empty, DbType.String,
                                                ParameterDirection.Output, Common.PARAM_OUTPUT_LENGTH));

                    using (DataSet ds = dtManager.ExecuteDataSet(spName, dbParam))
                    {
                        errorMessage = dbParam[Common.PARAM_OUTPUT].Value.ToString();

                        if (errorMessage.Length == 0 && ds != null && ds.Tables.Count > 0) //No dbError
                        {
                            dtVendor = ds.Tables[0];
                            if (ds.Tables[0].Rows.Count == 1)
                            {
                                objDetails.PODate = Convert.ToDateTime(ds.Tables[0].Rows[0]["PODate"]).ToString(Common.DATE_TIME_FORMAT);
                                //objDetails.DisplayPODate = Convert.ToDateTime(ds.Tables[0].Rows[0]["PODate"]).ToString(Common.DTP_DATE_FORMAT);
                                objDetails.PONumber = Convert.ToString(ds.Tables[0].Rows[0]["PONumber"]);
                                objDetails.POQty    = Convert.ToInt32(ds.Tables[0].Rows[0]["POQty"]);
                                objDetails.POAmount = Convert.ToDouble(ds.Tables[0].Rows[0]["MRP"]);
                            }
                            else
                            {
                            }
                        }
                    }
                }

                return(dtVendor);
            }
            catch (Exception)
            {
                throw;
            }
        }