public string T_Information_Select() { T_InformationModel tinfo = new T_InformationModel(); InformationBL ibl = new InformationBL(); return(DataTableToJSONWithJSONNet(ibl.T_Information_Select())); }
public string M_Group_Select() { T_InformationModel tinfo = new T_InformationModel(); InformationBL ibl = new InformationBL(); return(DataTableToJSONWithJSONNet(ibl.Get_M_GroupName())); }
public ActionResult product_details(string id) { Session["ProductDetailsID"] = id.ToString(); InformationBL bl = new InformationBL(); DataTable dt = bl.Get_InformationTitleName(id); for (var i = 0; i < dt.Rows.Count; i++) { var titlename = dt.Rows[i]["TitleName"].ToString(); var infodate = dt.Rows[i]["Column1"].ToString(); var detailinfo = dt.Rows[i]["DetailInformation"].ToString(); var attachfile1 = dt.Rows[i]["AttachedFile1"].ToString(); var attachfile2 = dt.Rows[i]["AttachedFile2"].ToString(); var attachfile3 = dt.Rows[i]["AttachedFile3"].ToString(); var attachfile4 = dt.Rows[i]["AttachedFile4"].ToString(); ViewData["InfoTitle"] = titlename; ViewData["InfoDate"] = infodate; ViewData["DetailInfo"] = detailinfo; if (!string.IsNullOrWhiteSpace(attachfile1)) { ViewData["Attach1"] = attachfile1 + " ▼"; } else { ViewData["Attach1"] = null; } if (!string.IsNullOrWhiteSpace(attachfile2)) { ViewData["Attach2"] = attachfile2 + " ▼"; } else { ViewData["Attach2"] = null; } if (!string.IsNullOrWhiteSpace(attachfile3)) { ViewData["Attach3"] = attachfile3 + " ▼"; } else { ViewData["Attach3"] = null; } if (!string.IsNullOrWhiteSpace(attachfile4)) { ViewData["Attach4"] = attachfile4 + " ▼"; } else { ViewData["Attach4"] = null; } } return(View()); }
public string Get_Detail_Information() { M_CompanyModel mc = new M_CompanyModel(); mc.CompanyCD = Session["CompanyCD"].ToString(); InformationBL ibl = new InformationBL(); return(DataTableToJSONWithJSONNet(ibl.GetInformation(mc))); }
public string CompanyUpdateView_Edit(String id) { InformationBL ibl = new InformationBL(); if (id != null) { DataTable dtinfo = new DataTable(); dtinfo = ibl.T_Information_Select_For_Edit(id); if (dtinfo.Rows.Count > 0) { string jsonresult; jsonresult = JsonConvert.SerializeObject(dtinfo); return(jsonresult); } } return(null); }
public string T_Information_Delete(string id) { var message = string.Empty; if (id == null) { message = "NOK"; } InformationBL ibl = new InformationBL(); string InsertOperator = Session["CompanyCD"].ToString(); string PcName = System.Environment.MachineName; message = ibl.News_Editor_Delete(id, PcName, InsertOperator); return(JsonConvert.SerializeObject(message)); }
public string M_Companay_Select() { InformationBL ibl = new InformationBL(); return(DataTableToJSONWithJSONNet(ibl.Get_M_CompanyName())); }
public ActionResult T_Information_SaveEdit(MultipleModel model, List <HttpPostedFileBase> Insertfile, string SendEditFile, string CancleFile) { string SaveFileName = string.Empty; //string path = Server.MapPath("~/AttachFiles/"); if (!Directory.Exists(InformationFiles)) { Directory.CreateDirectory(InformationFiles); } var getExitFiles = Directory.GetFiles(InformationFiles); string MatchFiles = ""; if (!string.IsNullOrWhiteSpace(SendEditFile) || !string.IsNullOrWhiteSpace(CancleFile)) { MatchFiles = MatchEditFies(CancleFile, SendEditFile); } if (!String.IsNullOrWhiteSpace(MatchFiles.Replace(',', ' '))) { var EditFiles = MatchFiles.TrimEnd(',').Split(','); var k = EditFiles.Count(); if (EditFiles.Count() > 0) { while (k > 0) { foreach (var exfile in getExitFiles) { //var exitFile = (exfile.Split('\\'))[6].Split('.')[0]; var exitFile = exfile.Split('\\'); //string filename = exitFile[exitFile.Length - 1].Split('.')[0]; //if (filename == EditFiles[k - 1].Split('.')[0]) //{ // SaveFileName += filename + ","; //} string filename = exitFile[exitFile.Length - 1]; if (filename == EditFiles[k - 1]) { SaveFileName += filename + ","; } } k = k - 1; } } } if (Insertfile != null) { foreach (HttpPostedFileBase postedFile in Insertfile) { if (postedFile != null) { string fileName = Path.GetFileName(postedFile.FileName); postedFile.SaveAs(InformationFiles + fileName); SaveFileName += fileName + ","; } } } if (!String.IsNullOrWhiteSpace(SaveFileName)) { SaveFileName = SaveFileName.TrimEnd(','); var AttachFiles = SaveFileName.Split(','); for (int i = 0; i < AttachFiles.Length; i++) { if ((AttachFiles[i] != null) || (AttachFiles[i].Trim().Length != 0)) { if (i == 0) { model.TinfoModel.AttachedFile1 = AttachFiles[i].ToString(); } else if (i == 1) { model.TinfoModel.AttachedFile2 = AttachFiles[i].ToString(); } else if (i == 2) { model.TinfoModel.AttachedFile3 = AttachFiles[i].ToString(); } else { model.TinfoModel.AttachedFile4 = AttachFiles[i].ToString(); } } } } Boolean insertflag = true; InformationBL ibl = new InformationBL(); model.TinfoModel.InsertOperator = Session["CompanyCD"].ToString(); string PcName = System.Environment.MachineName; if (model.TinfoModel.InformationID == 0) { insertflag = ibl.News_Editor_Save(model, PcName); if (insertflag) { TempData["Save"] = "Save Successfully"; } else { TempData["Nosave"] = "Save Failed"; } } else { insertflag = ibl.News_Editor_Save(model, PcName); if (insertflag) { TempData["update"] = "Updated Successfully"; } else { TempData["noupdate"] = "Update Failed"; } } return(RedirectToAction("News_Editor")); }