コード例 #1
0
        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(""));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
 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());
 }
コード例 #5
0
        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));
        }
コード例 #6
0
        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));
        }
コード例 #7
0
        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()));
        }
コード例 #8
0
        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);
        }
コード例 #9
0
        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));
        }
コード例 #10
0
        public ActionResult Warehouse()
        {
            PLog.Info("BEGIN::Controller > Home, Method >Warehouse() ");
            WareHouseModel objModel = new WareHouseModel();

            PLog.Info("END::Controller > Home, Method > Warehouse()");
            return(View(objModel));
        }
コード例 #11
0
 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());
 }
コード例 #12
0
        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));
        }
コード例 #13
0
        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));
        }
コード例 #14
0
        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));
        }
コード例 #15
0
        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());
        }
コード例 #16
0
        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));
        }
コード例 #17
0
        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()));
        }
コード例 #18
0
        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()));
        }
コード例 #19
0
        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());
        }
コード例 #20
0
        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));
        }
コード例 #21
0
        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));
        }
コード例 #22
0
        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()));
        }
コード例 #23
0
        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));
        }
コード例 #24
0
        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()));
        }
コード例 #25
0
        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);
        }
コード例 #26
0
        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));
        }
コード例 #27
0
        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));
        }
コード例 #28
0
        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);
        }
コード例 #29
0
        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);
        }
コード例 #30
0
        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));
        }