public ActionResult DepartmentSetup() { //CRM.Models.clsSubmitModel oSubmit = new CRM.Models.clsSubmitModel(); studdet frm = new studdet(); var vwDepartment = from a in db.studdets where a.studType == 11 orderby a.studName select new { itgpName = a.studName, itgpcode = a.studCode }; ViewBag.vwDepartment = new SelectList(vwDepartment, "itgpcode", "itgpName"); return(PartialView(frm)); }
public ActionResult SourceMaster(int iCode = 0, int iType = 50) { //CRM.Models.clsSubmitModel oSubmit = new CRM.Models.clsSubmitModel(); studdet frm = new studdet(); frm.studType = iType; if (iCode > 0) { frm = oSubmit.GetSource("select * from studdet where studCode =" + iCode + " and studType =" + iType); } return(PartialView(frm)); }
public ActionResult InsSource(studdet frm) { clsSubmitModel oSubmit = new clsSubmitModel(); //int MstCode = 0; DataTable dt; if (frm.studCode > 0) { oSubmit.insertData("Update studdet Set studName ='" + frm.studName + "' , studadd1 ='" + frm.studadd1 + "' Where studCode =" + frm.studCode + " and studType =" + frm.studType, true); } else { dt = oSubmit.GetData("select isnull(max(studCode),0)+1 studCode from studdet where studType =" + frm.studType, true); frm.studCode = Convert.ToInt32(dt.Rows[0]["studCode"].ToString()); oSubmit.insertData("insert into studdet (studCode, studName , studType ,studadd1) values ( " + frm.studCode + ",'" + frm.studName + "'," + frm.studType + ",'" + frm.studadd1 + "')", true); } return(Json(1, JsonRequestBehavior.AllowGet)); }
public ActionResult Complaint(clsComplaint oTbl) { string sLine = ""; var sMsg = new { Message = "Successfully Saved ...", MsgID = 1, ComplaintNo = "0" }; try { string CompNo = DateTime.Now.Date.Date.ToString("yy") + DateTime.Now.Date.Date.ToString("MM") + DateTime.Now.Date.Date.ToString("dd"); int iCustID = 0; tblComplaint oComp = new tblComplaint(); oComp.CustID = oTbl.CustID; if (oTbl.IsNewCust == 1) { iCustID = Convert.ToInt32(oSubmit.GetSingleData("Select isnull(max(studCode)+1,1) from studdet where studType = 68", "0", true)); studdet Cust = new studdet(); Cust.studType = 68; Cust.studCode = iCustID; Cust.studName = oTbl.studName; Cust.studadd1 = oTbl.studadd1; Cust.studadd2 = oTbl.studadd2; Cust.studcity = oTbl.studcity; Cust.studstat = oTbl.studstat; Cust.studphon = oTbl.studphon; db.studdets.InsertOnSubmit(Cust); db.SubmitChanges(); oComp.CustID = iCustID; } sLine = "1"; oComp.CompNo = CompNo + GetNo(oSubmit.GetSingleData("Select isnull(max(CompID)+1,1) from tblComplaint", "0", true).ToString()); //oComp.CompDt = oSubmit.GetDateFormat(oTbl.CompDt.ToString()); sLine = "2"; oComp.CreatedOn = DateTime.Now; oComp.StatusID = 1; oComp.UserID = SessionMaster.UserID; sLine = "3"; if (oTbl.sTentetiveTm != null && oTbl.sTentetiveTm.ToString() != "") { oComp.TentetiveTm = oSubmit.GetDate(oTbl.sTentetiveTm.ToString()); } sLine = "4"; sLine += oTbl.CompDt.ToString(); oComp.CompDt = oSubmit.GetDate(oTbl.sCompDt.ToString()); sLine = "5"; oComp.DealerID = oTbl.DealerID; oComp.CustNM = oTbl.CustNM; oComp.ModelNo = oTbl.ModelNo; oComp.SrvType = oTbl.SrvType; oComp.EmpID = oTbl.EmpID; oComp.ItemID = oTbl.ItemID; oComp.InvNo = oTbl.InvNo; oComp.Charge = oTbl.Charge; oComp.Remark_Cust = oTbl.Remark_Cust; oComp.Remark_Mgr = oTbl.Remark_Eng; //Remark_Eng to Remark_Mgr 181101 oComp.cmIsRead = 1; //181027 oComp.cmIsPaid = oTbl.IsPaid; //181027 oComp.cmSrvcMode = oTbl.IsSrvcMode; //181027 oComp.cmCategory = oTbl.Category; //181027 db.tblComplaints.InsertOnSubmit(oComp); db.SubmitChanges(); CompNo = CompNo + GetNo(oSubmit.GetSingleData("Select isnull(max(CompID)+1,1) from tblComplaint", "0", true).ToString()); sMsg = new { Message = "Complaint Successfully Registered . Your Complaint No Is " + CompNo + " .", MsgID = 1, ComplaintNo = CompNo }; } catch (Exception ex) { sMsg = new { Message = sLine + "#" + ex.Message, MsgID = 2, ComplaintNo = "0" }; } return(Json(sMsg, JsonRequestBehavior.AllowGet)); }