public string SaveDocumentIN(string Data) { PLog.Info("BEGIN::Controller > GridStock, Method >SaveDocumentIN(string Data):::" + Data); string DocName = ""; try { InwardDocumentImple objModel = JsonConvert.DeserializeObject <InwardDocumentImple>(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 > SaveDocumentIN(string Data)", ex); } PLog.Info("END::Controller > GridStock, Method >SaveDocumentIN(string Data):::" + Data); return(DocName); }
public string LoadInwardStockDocuments() { PLog.Info("BEGIN::Controller > GridStock, Method >LoadInwardStockDocuments()"); 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(); InwardDocumentImple objModel = new InwardDocumentImple(); ds = objModel.GetGirdData(0);//0 will get all the active inward 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 > LoadInwardStockDocuments()", ex); } PLog.Info("END::Controller > GridStock, Method >LoadInwardStockDocuments()"); return(serializer.Serialize(rows)); }
public ActionResult AddInStock() { PLog.Info("BEGIN::Controller > GridStock, Method >AddInStock()"); InwardDocumentImple objModel = new InwardDocumentImple(); try { objModel.init(); } catch (Exception ex) { PLog.Error("Error::Controller >GridStock, Method > AddInStock()", ex); } PLog.Info("END::Controller > GridStock, Method >AddInStock()"); return(View(objModel)); }
public ActionResult UpDateInStock(string DocID) { PLog.Info("BEGIN::Controller > GridStock, Method >UpDateInStock(string DocID)"); InwardDocumentImple objModel = new InwardDocumentImple(); try { if (!string.IsNullOrEmpty(DocID)) { objModel.EditDocument(Convert.ToInt32(DocID)); } } catch (Exception ex) { PLog.Error("Error::Controller >GridStock, Method > UpDateInStock(string DocID)", ex); } PLog.Info("END::Controller > GridStock, Method >UpDateInStock(string DocID)"); return(View("AddInStock", objModel)); }
public ActionResult DeleteInStock(string DocID) { PLog.Info("BEGIN::Controller > GridStock, Method >DeleteInStock(string DocID)"); long flg = 0; if (!string.IsNullOrEmpty(DocID)) { try { InwardDocumentImple obj = new InwardDocumentImple(); flg = obj.DeleteDocument(Convert.ToInt32(DocID)); } catch (Exception ex) { PLog.Error("Error::Controller >GridStock, Method > DeleteInStock(string DocID)", ex); } } PLog.Info("END::Controller > GridStock, Method >DeleteInStock(string DocID)"); return(Content(flg.ToString())); }