Ejemplo n.º 1
0
        public async Task <ActionResult> SaveStockRequest(StockInOutModel ob)
        {
            var StockReqId = 0;

            ob.UserId = objSessionManager.UserID;
            string url = StVariable.ApiUri + "/api/StockInOut/SaveStockRequest";

            if (ModelState.IsValid)
            {
                client.BaseAddress = new Uri(url);
                HttpResponseMessage responseMessage = await client.PostAsJsonAsync(url, ob);

                if (responseMessage.IsSuccessStatusCode)
                {
                    var responseData = responseMessage.Content.ReadAsStringAsync().Result.Replace("\"", "").Split('|');
                    if (responseData[1] == "")
                    {
                        StockReqId = Convert.ToInt16(responseData[0]);
                        return(RedirectToAction("StockInItem", new { StockReqId = StockReqId }));
                        // return Json(new { success = true }, JsonRequestBehavior.AllowGet);
                    }
                }
            }
            return(Json(new { success = false }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
 public string SaveStockTransfer(StockInOutModel ob)
 {
     try
     {
         _sql                = "SaveStockTransfer";
         _parms              = new SqlParameter[7];
         _parms[0]           = new SqlParameter("@StockReqId", SqlDbType.Int);
         _parms[0].Value     = ob.StockReqId;
         _parms[1]           = new SqlParameter("@BDate", SqlDbType.DateTime);
         _parms[1].Value     = ob.BDate;
         _parms[2]           = new SqlParameter("@Status", SqlDbType.Int);
         _parms[2].Value     = ob.Status;
         _parms[3]           = new SqlParameter("@UserId", SqlDbType.Int);
         _parms[3].Value     = ob.UserId;
         _parms[4]           = new SqlParameter("@Reference", SqlDbType.NVarChar);
         _parms[4].Value     = ob.Reference;
         _parms[5]           = new SqlParameter("@ListData", SqlDbType.NVarChar);
         _parms[5].Value     = ob.strStockInOutItemModel;
         _parms[6]           = new SqlParameter("@ReturnValue", SqlDbType.NVarChar, 1000);
         _parms[6].Direction = ParameterDirection.Output;
         return(Convert.ToString(RunProcedure(_sql, "@ReturnValue", _parms)));
     }
     catch (Exception ex)
     {
         return(ex.ToString());
     }
 }
Ejemplo n.º 3
0
        //[ResponseType(typeof(OrderModel))]
        public IHttpActionResult SaveStockRequest(StockInOutModel ob)
        {
            System.Diagnostics.Debugger.Break();
            string str = obj.SaveStockRequest(ob);

            return(Ok(str));
        }
Ejemplo n.º 4
0
        public async Task <ActionResult> StockInItem(int StockReqId)
        {
            string          url   = StVariable.ApiUri + "/api/StockInOut/GetStockRequestDetail?Qtype=ID&StockReqId=" + StockReqId;
            StockInOutModel model = null;

            client.BaseAddress = new Uri(url);
            HttpResponseMessage responseMessage = await client.GetAsync(url);

            if (responseMessage.IsSuccessStatusCode)
            {
                var responseData = responseMessage.Content.ReadAsStringAsync().Result;
                model = JsonConvert.DeserializeObject <StockInOutModel>(responseData);
            }
            return(View(model));
        }
Ejemplo n.º 5
0
        public StockInOutModel DisplayStockRequestDetail(string Qtype, int StockReqId)
        {
            StockInOutModel objlist = new StockInOutModel();
            DataSet         ds      = obj.DisplayStockRequest(Qtype, StockReqId, 0, 0, DateTime.Now, DateTime.Now);

            if (ds.Tables[0].Rows.Count > 0)
            {
                objlist = ds.Tables[0].AsEnumerable().Select(x => new StockInOutModel
                {
                    StockReqId  = x.Field <int>("StockReqId"),
                    TransferNo  = x.Field <string>("TransferNo"),
                    In_StoreId  = x.Field <int>("In_StoreId"),
                    In_Store    = x.Field <string>("In_Store"),
                    BDate       = x.Field <DateTime>("BDate"),
                    Out_StoreId = x.Field <int>("Out_StoreId"),
                    Out_Store   = x.Field <string>("Out_Store"),
                    Status      = x.Field <int>("Status"),
                    Reference   = x.Field <string>("Reference"),
                    CreatedBy   = x.Field <string>("CreatedBy"),
                    CreatedOn   = x.Field <string>("CreatedOn"),
                    ModifiedBy  = x.Field <string>("ModifiedBy"),
                    ModifiedOn  = x.Field <string>("ModifiedOn")
                }).FirstOrDefault();
            }
            if (ds.Tables[1].Rows.Count > 0)
            {
                objlist.lstStockInOutItemModel = ds.Tables[1].AsEnumerable().Select(x => new StockInOutItemModel
                {
                    StockReqId = x.Field <int>("StockReqId"),
                    ItemId     = x.Field <int>("ItemId"),
                    ItemCode   = x.Field <int>("ItemCode"),
                    ItemName   = x.Field <string>("ItemName"),
                    Qty        = x.Field <decimal>("Qty"),
                    UnitName   = x.Field <string>("UnitName")
                }).ToList();
            }
            return(objlist);
        }
Ejemplo n.º 6
0
 public string SaveStockTransfer(StockInOutModel objMedel)
 {
     return(obj.SaveStockTransfer(objMedel));
 }
Ejemplo n.º 7
0
 public string SaveStockRequest(StockInOutModel objMedel)
 {
     return(obj.SaveStockRequest(objMedel));
 }
Ejemplo n.º 8
0
        public IHttpActionResult SaveStockTransfer(StockInOutModel ob)
        {
            string str = obj.SaveStockTransfer(ob);

            return(Ok(str));
        }