public ActionResult GetNextPrevDoc(string _Action, int DocType, int DocNo) { PLog.Info("BEGIN::Controller > GridStock, Method > GetNextPrevDoc"); CommonImple _CommonImple = new CommonImple(); if (DocType == 1)//opening stocks { DataSet ds = _CommonImple.GetNextPrevDocData(DocType); int x = GetDocNo(ds, DocNo, _Action); if (x == 0) { return(RedirectToAction("AddOpStock")); } else { return(RedirectToAction("UpDateOpStock", new { DocID = x })); } } else if (DocType == 2) { DataSet ds = _CommonImple.GetNextPrevDocData(DocType); int x = GetDocNo(ds, DocNo, _Action); if (x == 0) { return(RedirectToAction("AddInStock")); } else { return(RedirectToAction("UpDateInStock", new { DocID = x })); } } else if (DocType == 3) { DataSet ds = _CommonImple.GetNextPrevDocData(DocType); int x = GetDocNo(ds, DocNo, _Action); if (x == 0) { return(RedirectToAction("AddOutStock")); } else { return(RedirectToAction("UpdateOutStock", new { DocID = x })); } } else if (DocType == 4) { DataSet ds = _CommonImple.GetNextPrevDocData(DocType); int x = GetDocNo(ds, DocNo, _Action); if (x == 0) { return(RedirectToAction("AddStockTransfer")); } else { return(RedirectToAction("UpDateStockTransfer", new { DocID = x })); } } return(Content("")); }
public string GetProductCategory() { PLog.Info("BEGIN::Controller > GridStock, Method > GetProductCategory"); System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); List <Dictionary <string, object> > rows = new List <Dictionary <string, object> >(); try { IProductsCategoryImple oProducts = new ProductsCategoryImple(); DataTable dt = oProducts.GetGridData(0); //0 will gets all the products data Dictionary <string, object> row; foreach (DataRow dr in dt.Rows) { row = new Dictionary <string, object>(); foreach (DataColumn col in dt.Columns) { row.Add(col.ColumnName, dr[col]); } rows.Add(row); } } catch (Exception ex) { PLog.Error("Error::Controller >GridStock, Method > GetProductCategory", ex); } PLog.Info("END::Controller > GridStock, Method > GetProductCategory"); return(serializer.Serialize(rows)); }
public string Getcustomers() { PLog.Info("BEGIN::Controller > Home, Method >LoadWarehouses "); List <Dictionary <string, object> > rows = new List <Dictionary <string, object> >(); try { ICustomerImple oCustomerImple = new CustomerImple(); DataTable dt = oCustomerImple.GetGridData(0); //0 will gets all the customers data Dictionary <string, object> row; foreach (DataRow dr in dt.Rows) { row = new Dictionary <string, object>(); foreach (DataColumn col in dt.Columns) { row.Add(col.ColumnName, dr[col]); } rows.Add(row); } } catch (Exception ex) { PLog.Error("Error::Controller > Home, Method > LoadWarehouses()", ex); } PLog.Info("END::Controller > Home, Method > LoadWarehouses"); return(Newtonsoft.Json.JsonConvert.SerializeObject(rows)); }
public ActionResult Login() { ViewBag.Message = "This is the Login Page"; PLog.Info("BEGIN::Controller > Home, Method > Login"); PLog.Info("END::Controller > Home, Method >Login"); return(View()); }
public string LoadStockTransferDocuments() { PLog.Info("BEGIN::Controller > GridStock, Method > LoadStockTransferDocuments()"); System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); List <Dictionary <string, object> > rows = new List <Dictionary <string, object> >(); try { DataSet ds = new DataSet(); StockTransferImple objModel = new StockTransferImple(); ds = objModel.GetGirdData(0);//0 will get all the active StockTransfer masters data DataTable dt = ds.Tables[0]; Dictionary <string, object> row; foreach (DataRow dr in dt.Rows) { row = new Dictionary <string, object>(); foreach (DataColumn col in dt.Columns) { row.Add(col.ColumnName, dr[col]); } rows.Add(row); } } catch (Exception ex) { PLog.Error("Error::Controller >GridStock, Method > LoadStockTransferDocuments()", ex); } PLog.Info("END::Controller > GridStock, Method > LoadStockTransferDocuments()"); return(serializer.Serialize(rows)); }
public string WarehouseData() { PLog.Info("BEGIN::Controller > GridStock, Method > WarehouseData"); List <Dictionary <string, object> > rows = new List <Dictionary <string, object> >(); System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); Dictionary <string, object> row; try { IWareHouseImple oWareHouse = new WareHouseImple(); DataTable dt = oWareHouse.GetGridData(0); //0 will gets all the WareHouse data foreach (DataRow dr in dt.Rows) { row = new Dictionary <string, object>(); foreach (DataColumn col in dt.Columns) { row.Add(col.ColumnName, dr[col]); } rows.Add(row); } } catch (Exception ex) { PLog.Error("Error::Controller >GridStock, Method >WarehouseData", ex); throw; } PLog.Info("END::Controller > GridStock, Method > WarehouseData"); return(serializer.Serialize(rows)); }
public ActionResult LoginSubmit(string email, string password, int RememberMe) { PLog.Info("BEGIN::Controller > Home, Method > LoginSubmit(string email, string password)"); int Flg = 0; try { // str = Convert.ToInt32(str).ToString(); if (!string.IsNullOrEmpty(email) && !string.IsNullOrEmpty(password)) { LoginImple obj = new LoginImple(); Flg = obj.CheckLogin(email, password); if (Flg > 0) { CreateLoginCookies(RememberMe, email, password); } } } catch (Exception ex) { PLog.Error("Error::Controller > Home, Method > LoginSubmit", ex); } PLog.Info("END::Controller > Home, Method > LoginSubmit"); return(Content(Flg.ToString())); }
public string SaveDocumentOUT(string Data) { PLog.Info("BEGIN::Controller > GridStock, Method > SaveDocumentOUT(string Data):::" + Data); string DocName = ""; try { OutwardDocumentImple objModel = JsonConvert.DeserializeObject <OutwardDocumentImple>(Data); long Flg = 0; string[] sD = objModel.DocDate.Split('-'); objModel.DocDate = new DateTime(Convert.ToInt32(sD[2]), Convert.ToInt32(sD[1]), Convert.ToInt32(sD[0])).ToString(); if (!string.IsNullOrEmpty(objModel.EffectiveDate)) { string[] sD1 = objModel.EffectiveDate.Split('-'); objModel.EffectiveDate = new DateTime(Convert.ToInt32(sD1[2]), Convert.ToInt32(sD1[1]), Convert.ToInt32(sD1[0])).ToString(); } DocName = objModel.SaveDocument(out Flg); if (Flg == -494) { DocName = "-494"; } } catch (Exception ex) { PLog.Error("Error::Controller >GridStock, Method > SaveDocumentOUT(string Data)", ex); } PLog.Info("END::Controller > GridStock, Method > SaveDocumentOUT(string Data):::" + Data); return(DocName); }
public string LoadUsers() { PLog.Info("BEGIN::Controller > Home, Method > LoadUsers()"); List <Dictionary <string, object> > rows = new List <Dictionary <string, object> >(); System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); try { UsersImple objUsersImple = new UsersImple(); DataTable dt = objUsersImple.GetGridData(0); //0 will gets all the users data Dictionary <string, object> row; foreach (DataRow dr in dt.Rows) { row = new Dictionary <string, object>(); foreach (DataColumn col in dt.Columns) { row.Add(col.ColumnName, dr[col]); } rows.Add(row); } } catch (Exception ex) { PLog.Error("Error::Controller > Home, Method > LoadUsers()", ex); } PLog.Info("END::Controller > Home, Method > LoadUsers()"); return(serializer.Serialize(rows)); }
public ActionResult Warehouse() { PLog.Info("BEGIN::Controller > Home, Method >Warehouse() "); WareHouseModel objModel = new WareHouseModel(); PLog.Info("END::Controller > Home, Method > Warehouse()"); return(View(objModel)); }
public ActionResult ProductsCategoryList() { PLog.Info("BEGIN::Controller > Home, Method > ProductCategoryList()"); try { var str = LoadProductsCategory(); ViewBag.Data = str; } catch (Exception ex) { PLog.Error("Error::Controller > Home, Method > ProductCategoryList()", ex); } PLog.Info("END::Controller > Home, Method > ProductCategoryList()"); return(View()); }
public ActionResult AddOutStock() { PLog.Info("BEGIN::Controller > GridStock, Method >AddOutStock()"); OutwardDocumentImple objModel = new OutwardDocumentImple(); try { objModel.init(); } catch (Exception ex) { PLog.Error("Error::Controller >GridStock, Method > AddOutStock()", ex); } PLog.Info("END::Controller > GridStock, Method >AddOutStock()"); return(View(objModel)); }
public ActionResult UserCreation() { PLog.Info("BEGIN::Controller > Home, Method > UserCreation()"); UsersModel obj = null; try { obj = new UsersModel(); } catch (Exception ex) { PLog.Error("Error::Controller > Home, Method > UserCreation()", ex); } PLog.Info("END::Controller > Home, Method > UserCreation()"); return(View(obj)); }
public ActionResult AddStockTransfer() { PLog.Info("BEGIN::Controller > GridStock, Method > AddStockTransfer()"); StockTransferImple objModel = new StockTransferImple(); try { objModel.init(); } catch (Exception ex) { PLog.Error("Error::Controller >GridStock, Method > AddStockTransfer()", ex); } PLog.Info("END::Controller > GridStock, Method > AddStockTransfer()"); return(View(objModel)); }
public ActionResult Index() { PLog.Info("BEGIN::Controller > Home, Method > Users()"); string str = ""; try { str = LoadUsers(); ViewBag.Data = str; } catch (Exception ex) { PLog.Error("Error::Controller > Home, Method > Users()", ex); } PLog.Info("END::Controller > Home, Method > Users()"); return(View()); }
public ActionResult GetQuickStockReport() { PLog.Info("BEGIN::Controller > GridStock, Method >GetStockReport()"); StockReportImple objModel = new StockReportImple(); try { objModel.GetStockReportData(); objModel.GenerateReportData(); } catch (Exception ex) { PLog.Error("Error::Controller >GridStock, Method > GetStockReport()", ex); } PLog.Info("END::Controller > GridStock, Method > GetStockReport()"); return(View(objModel)); }
public ActionResult SaveCustomer(string Data) { PLog.Info("BEGIN::Controller > Home, Method > SaveProduct(string Data)"); long flg = 0; ICustomerImple oCustomerImple = new CustomerImple(); try { CustomerModel obj = JsonConvert.DeserializeObject <CustomerModel>(Data); flg = oCustomerImple.Save(obj); } catch (Exception ex) { PLog.Error("Error::Controller > Home, Method > SaveProduct(string Data)", ex); } PLog.Info("END::Controller > Home, Method > SaveProduct(string Data)"); return(Content(flg.ToString())); }
public ActionResult SaveProductsCategory(string Data) { PLog.Info("BEGIN::Controller > Home, Method > SaveProductsCategory(string Data)"); long flg = 0; try { ProductsCategoryModel obj = JsonConvert.DeserializeObject <ProductsCategoryModel>(Data); IProductsCategoryImple oProducts = new ProductsCategoryImple(); flg = oProducts.SaveProductCategory(obj); } catch (Exception ex) { PLog.Error("Error::Controller > Home, Method > SaveProductsCategory(string Data)", ex); } PLog.Info("END::Controller > Home, Method > SaveProductsCategory(string Data)"); return(Content(flg.ToString())); }
public ActionResult CustomersList() { PLog.Info("BEGIN::Controller > Home, Method >Warehouses "); string str = ""; try { str = Getcustomers(); ViewBag.Data = str; } catch (Exception ex) { PLog.Error("Error::Controller > Home, Method > Warehouses", ex); } PLog.Info("END::Controller > Home, Method > Warehouses"); return(View()); }
public ActionResult UpdateOutStock(string DocID) { PLog.Info("BEGIN::Controller > GridStock, Method >UpdateOutStock(string DocID)"); OutwardDocumentImple objModel = new OutwardDocumentImple(); if (!string.IsNullOrEmpty(DocID)) { try { objModel.EditDocument(Convert.ToInt32(DocID)); } catch (Exception ex) { PLog.Error("Error::Controller >GridStock, Method > UpdateOutStock(string DocID)", ex); } } PLog.Info("END::Controller > GridStock, Method >UpdateOutStock(string DocID)"); return(View("AddOutStock", objModel)); }
public ActionResult UpDateStockTransfer(string DocID) { PLog.Info("BEGIN::Controller > GridStock, Method > UpDateStockTransfer(string DocID)"); StockTransferImple objModel = new StockTransferImple(); try { if (!string.IsNullOrEmpty(DocID)) { objModel.EditDocument(Convert.ToInt32(DocID)); } } catch (Exception ex) { PLog.Error("Error::Controller >GridStock, Method >UpDateStockTransfer(string DocID)", ex); } PLog.Info("END::Controller > GridStock, Method > UpDateStockTransfer(string DocID)"); return(View("AddStockTransfer", objModel)); }
public ActionResult SaveUser(string Data) { PLog.Info("BEGIN::Controller > Home, Method > SaveUser(string Data)"); long flg = 0; try { UsersImple objUsersImple = new UsersImple(); UsersModel objUser = JsonConvert.DeserializeObject <UsersModel>(Data); flg = objUsersImple.SaveUsers(objUser); } catch (Exception ex) { PLog.Error("Error::Controller > Home, Method > SaveUser(string Data)", ex); } PLog.Info("END::Controller > Home, Method > SaveUser(string Data)"); return(Content(flg.ToString())); }
public ActionResult UpdateProduct(string ID) { PLog.Info("BEGIN::Controller > Home, Method > UpdateProduct(string ID"); IProductsImple oProductsImple = new ProductsImple(); ProductsModel objModel = null; try { if (!string.IsNullOrEmpty(ID)) { objModel = oProductsImple.EditProdcut(Convert.ToInt32(ID)); } } catch (Exception ex) { PLog.Error("Error::Controller > Home, Method > UpdateProduct(string ID)", ex); } PLog.Info("END::Controller > Home, Method > UpdateProduct(string ID)"); return(View("Products", objModel)); }
public ActionResult SaveProduct(string Data) { PLog.Info("BEGIN::Controller > Home, Method > SaveProduct(string Data)"); long flg = 0; IProductsImple oProductsImple = new ProductsImple(); try { ProductsModel obj = JsonConvert.DeserializeObject <ProductsModel>(Data); string[] date = obj.efDate.Split('-'); obj.efDate = new DateTime(Convert.ToInt32(date[2]), Convert.ToInt32(date[1]), Convert.ToInt32(date[0])).ToString(); flg = oProductsImple.SaveProducts(obj); } catch (Exception ex) { PLog.Error("Error::Controller > Home, Method > SaveProduct(string Data)", ex); } PLog.Info("END::Controller > Home, Method > SaveProduct(string Data)"); return(Content(flg.ToString())); }
public long DeleteProductsCategory(string ID) { PLog.Info("BEGIN::Controller > Home, Method > DeleteProductsCategory(string ID)"); long ret = 0; if (!string.IsNullOrEmpty(ID)) { try { IProductsCategoryImple oProducts = new ProductsCategoryImple(); ret = oProducts.DeleteProductsCategory(Convert.ToInt32(ID)); } catch (Exception ex) { PLog.Error("Error::Controller > Home, Method > DeleteProductsCategory(string ID)", ex); } } PLog.Info("END::Controller > Home, Method > DeleteProductsCategory(string ID)"); return(ret); }
public ActionResult UpDateWarehouse(string ID) { PLog.Info("BEGIN::Controller > Home, Method >UpDateWarehouse(string ID) "); WareHouseModel objModel = null; IWareHouseImple oWareHouse = new WareHouseImple(); try { if (!string.IsNullOrEmpty(ID)) { objModel = oWareHouse.EditWareHouse(Convert.ToInt32(ID)); } } catch (Exception ex) { PLog.Error("Error::Controller > Home, Method > UpDateWarehouse(string ID) ", ex); } PLog.Info("END::Controller > Home, Method > UpDateWarehouse(string ID) "); return(View("Warehouse", objModel)); }
public ActionResult UpDateUser(string ID) { PLog.Info("BEGIN::Controller > Home, Method > UpDateUser(string ID)"); UsersImple objUsersImple = new UsersImple(); UsersModel objModel = null; try { if (!string.IsNullOrEmpty(ID)) { objModel = objUsersImple.EditUser(Convert.ToInt32(ID)); } } catch (Exception ex) { PLog.Error("Error::Controller > Home, Method > UpDateUser(string ID)", ex); } PLog.Info("END::Controller > Home, Method > UpDateUser(string ID)"); return(View("UserCreation", objModel)); }
public long DeleteUser(string ID) { PLog.Info("BEGIN::Controller > Home, Method > DeleteUser(string ID)"); long ret = 0; if (!string.IsNullOrEmpty(ID)) { try { UsersImple objUsersImple = new UsersImple(); ret = objUsersImple.DeleteUser(Convert.ToInt32(ID)); } catch (Exception ex) { PLog.Error("Error::Controller > Home, Method > DeleteUser(string ID)", ex); } } PLog.Info("END::Controller > Home, Method > DeleteUser(string ID)"); return(ret); }
public long DeleteWarehouse(string ID) { PLog.Info("BEGIN::Controller > Home, Method >DeleteWarehouse(string ID) "); long ret = 0; if (!string.IsNullOrEmpty(ID)) { try { IWareHouseImple oWareHouse = new WareHouseImple(); ret = oWareHouse.DeleteWareHouse(Convert.ToInt32(ID)); } catch (Exception ex) { PLog.Error("Error::Controller > Home, Method > DeleteWarehouse(string ID) ", ex); } } PLog.Info("END::Controller > Home, Method > DeleteWarehouse(string ID) "); return(ret); }
public ActionResult UpdateCustomer(string ID) { PLog.Info("BEGIN::Controller > UpdateCustomer, Method > UpdateCustomer(string ID"); ICustomerImple oCustomerImple = new CustomerImple(); CustomerModel objModel = null; try { if (!string.IsNullOrEmpty(ID)) { objModel = oCustomerImple.Edit(Convert.ToInt32(ID)); } } catch (Exception ex) { PLog.Error("Error::Controller > UpdateCustomer, Method > UpdateCustomer(string ID)", ex); } PLog.Info("END::Controller > UpdateCustomer, Method > UpdateCustomer(string ID)"); return(View("AddCustomer", objModel)); }