public List <BirthProcess> CountPending() { DataSet ds = null; List <BirthProcess> Birth_Process_list = null; try { con = Utility.Util.Connection("DBEntities"); SqlCommand cmd = new SqlCommand("[SP_PendingAction]", con); cmd.CommandType = CommandType.StoredProcedure; con.Open(); SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = cmd; ds = new DataSet(); da.Fill(ds); Birth_Process_list = new List <BirthProcess>(); #region For Display role in Table for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { BirthProcess Birth_P = new BirthProcess(); Birth_P.count = Convert.ToInt32(ds.Tables[0].Rows[i]["No_Of_Action"].ToString()); Birth_P.nextAction = ds.Tables[0].Rows[i]["NextAction"].ToString().Trim(); Birth_Process_list.Add(Birth_P); } #endregion } catch (Exception ex) { ex.Message.ToString(); } finally { con.Close(); } return(Birth_Process_list); }
public ActionResult BirthRegistration(BirthProcess BRobject, HttpPostedFileBase httpPostedFileBase) { int id = BRobject.ID; if (string.IsNullOrEmpty(BRobject.DocumentType)) { ModelState.AddModelError("DocumentType", "Please Select Document Type"); } obj = new BirthProcessAction(); int Custid = Convert.ToInt32(Session["Cust_ID"]); //Commented the lines below - Soumendu // //if (BRobject.CustomerGender == "Female") // { // BRobject.Name_of_Mother = BRobject.CustomerName; // } //else // { // BRobject.Name_of_Father = BRobject.CustomerName; // } string result = obj.create(BRobject, 1, Custid, BRobject.FormType); string[] line = result.Split('|'); string Rt = line[0].ToString(); string Appno = line[1].ToString(); string FormType_1 = BRobject.FormType; Session["AppNo"] = FormType_1 + "_" + Appno; Clear(); int Roleid = Convert.ToInt16(Session["SortedList1"]); int CustID = Convert.ToInt32(Session["Cust_ID"].ToString()); if (Rt == "Registered Successfully") { string fileSavePath = HttpContext.Server.MapPath("~/UploadedFiles/"); string rt = Utility.Util.AddDocuments(Request, BRobject.DocList, fileSavePath, FormType_1 + "_" + Appno, CustID); string AppNo = FormType_1 + "_" + Appno; List <MailNotification> MailInfo = obj.getMailInfo("BirthApplied", AppNo); for (int i = 0; i < MailInfo.Count; i++) { Utility.Util.INotificationService mailNotification = new Utility.Util.MailService ("*****@*****.**", MailInfo[i].Subject, MailInfo[i].MailAppNo); mailNotification.Notify(); } Message(); } TempData["Viewstr"] = Session["ViewData"].ToString(); TempData["ErrorMessage"] = "Your application has been register succesfully." + "\n Your application id no:" + Appno; return(RedirectToAction("Index", "Login")); }
public ActionResult BirthRegistration(string FormType) { string[] IE = Request.Params.AllKeys; BirthProcess BprocessView = new BirthProcess(); BprocessView.Date_of_Birth = System.DateTime.Today;//For Current Date BprocessView.Date_of_Death = System.DateTime.Today; int CustID = Convert.ToInt32(Session["Cust_ID"].ToString()); BprocessView.CustomerName = obj.CustomerDetails(CustID); BprocessView.CustomerAddress = obj.CustomerAddress(CustID); BprocessView.CustomerGender = obj.CustomerGender(CustID); // BprocessView.DocTypeList = objdocument.DocumentList(); if (FormType == "BR") { BprocessView.DocList = obj.DocumentList(1); //1 is process id } else { BprocessView.DocList = obj.DocumentList(2); //2 is process id } BprocessView.FormType = FormType; return(View(BprocessView)); }
public string CustomerDetails(int cust_ID) { con = Utility.Util.Connection("DBEntities"); string result = ""; string Name = ""; List <CustomerMaster_TBl> CMList = new List <CustomerMaster_TBl>(); try { //#region Birthregistration SqlCommand cmd = new SqlCommand("SP_Customer_Details", con); con.Open(); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ID", cust_ID); result = cmd.ExecuteScalar().ToString(); if (result.Equals(null)) { return(null); } SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = cmd; DataSet ds = new DataSet(); da.Fill(ds); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { BirthProcess CustomerTbl = new BirthProcess(); CustomerTbl.CustomerName = ds.Tables[0].Rows[i]["Name"].ToString(); CustomerTbl.CustomerAddress = ds.Tables[0].Rows[i]["Address"].ToString(); Name = ds.Tables[0].Rows[i]["Name"].ToString(); } } catch (Exception ex) { ex.StackTrace.ToString(); return(Name); } finally { con.Close(); } return(Name); }
public ActionResult ShowData(string actionname, string BnDType) { string name = actionname; string type = BnDType; BirthProcess Bprofile = new BirthProcess(); string[] line = actionname.Split('|'); string sts = line[0].ToString(); Bprofile.Status = sts; Bprofile.nextAction = actionname; BirthProcessAction objDB = new BirthProcessAction(); //calling class DBdata Bprofile.ShowallBirthRegis = objDB.GetAllEmployees(name, type); return(View(Bprofile)); }
public List <BirthProcess> CountPending(string getAction_ID, string getAction, int custId) { DataSet ds = null; string result = null; List <BirthProcess> Birth_Process_list = null; if (getAction_ID == null || getAction == null) { BirthProcess Birth_P = new BirthProcess(); Birth_P.count = 0; Birth_P.nextAction = "Page Is Unavailable"; Birth_Process_list.Add(Birth_P); } else { try { con = Utility.Util.Connection("DBEntities"); SqlCommand cmd = new SqlCommand("SP_PendingAction_Selection", con); //SqlCommand cmd = new SqlCommand("SP_look", con); con.Open(); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ActionID", getAction_ID); cmd.Parameters.AddWithValue("@Cust_Id", custId); result = Convert.ToString(cmd.ExecuteScalar()); #region List Of roles //if (result == "") //{ // cmd = new SqlCommand("SP_UserPending", con); // cmd.CommandType = CommandType.StoredProcedure; // cmd.Parameters.AddWithValue("@CustId", custId); // result = Convert.ToString(cmd.ExecuteScalar()); // if (result=="") // { // BirthProcess Birth_P = new BirthProcess(); // Birth_P.count = 0; // Birth_P.nextAction = "Not Assign"; // Birth_Process_list.Add(Birth_P); // } // else { // SqlDataAdapter da = new SqlDataAdapter(); // da.SelectCommand = cmd; // ds = new DataSet(); // da.Fill(ds); // Birth_Process_list = new List<BirthProcess>(); // for (int i = 0; i < ds.Tables[0].Rows.Count; i++) // { // BirthProcess Birth_P = new BirthProcess(); // Birth_P.count = Convert.ToInt32(ds.Tables[0].Rows[i]["No_Of_Action"].ToString()); // Birth_P.nextAction = ds.Tables[0].Rows[i]["NextAction"].ToString().Trim(); // Birth_Process_list.Add(Birth_P); // } // } //} //else //{ #endregion SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = cmd; ds = new DataSet(); da.Fill(ds); Birth_Process_list = new List <BirthProcess>(); #region For Display role in Table for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { BirthProcess Birth_P = new BirthProcess(); Birth_P.count = Convert.ToInt32(ds.Tables[0].Rows[i]["No_Of_Action"].ToString()); Birth_P.nextAction = ds.Tables[0].Rows[i]["NextAction"].ToString().Trim(); Birth_P.BnDType = ds.Tables[0].Rows[i]["BnDType"].ToString().Trim(); Birth_Process_list.Add(Birth_P); } #endregion //} if (Birth_Process_list.Count == 0) { BirthProcess Birth_P = new BirthProcess(); Birth_P.count = 0; Birth_P.nextAction = "No_Pending_action"; Birth_P.BnDType = ""; Birth_Process_list.Add(Birth_P); } } catch (Exception ex) { ex.Message.ToString(); } finally { con.Close(); } } return(Birth_Process_list); }
public string edit(IProcess bRobject1, int P_Id, int custid, string BnDType) { bRobject = (BirthProcess)bRobject1; //bRobject.processID = P_Id; ProcessActionseq(P_Id); con = Utility.Util.Connection("DBEntities"); string result = ""; string result2 = ""; string pageName = "Birth Registration"; try { #region Birthregistration SqlCommand cmd = new SqlCommand("Tbl_BirthRegistration_Update_SP", con); con.Open(); cmd.CommandType = CommandType.StoredProcedure; bRobject.Status = "BirthApplied"; cmd.Parameters.AddWithValue("@B_ID", checkAndGetValue((bRobject.ID).ToString())); cmd.Parameters.AddWithValue("@Name_of_Child", checkAndGetValue(bRobject.Name_of_Child)); cmd.Parameters.AddWithValue("@Gender_Of_Child", checkAndGetValue(bRobject.Gender_Of_Child)); cmd.Parameters.AddWithValue("@Name_of_Mother", checkAndGetValue(bRobject.Name_of_Mother)); cmd.Parameters.AddWithValue("@Date_of_Birth", checkAndGetDate(bRobject.Date_of_Birth)); cmd.Parameters.AddWithValue("@Place_of_Birth", checkAndGetValue(bRobject.Place_of_Birth)); cmd.Parameters.AddWithValue("@Gram_Panchayat_Unit", checkAndGetValue(bRobject.Gram_Panchayat_Unit)); cmd.Parameters.AddWithValue("@Nationality", checkAndGetValue(bRobject.Nationality)); cmd.Parameters.AddWithValue("@NameofBnDPerson", checkAndGetValue(bRobject.NameOfBnDperson)); cmd.Parameters.AddWithValue("@Date_of_Death", checkAndGetDate(bRobject.Date_of_Birth)); cmd.Parameters.AddWithValue("@PlaceofDeath", checkAndGetValue(bRobject.PlaceofDeath)); cmd.Parameters.AddWithValue("@AgeofDeceased", checkAndGetValue(bRobject.AgeofDeceased)); cmd.Parameters.AddWithValue("@Name_of_Father", checkAndGetValue(bRobject.Name_of_Father)); cmd.Parameters.AddWithValue("@Name_of_Informant", checkAndGetValue(bRobject.CustomerName)); cmd.Parameters.AddWithValue("@Address", checkAndGetValue(bRobject.CustomerAddress)); cmd.Parameters.AddWithValue("@FileName", ""); cmd.Parameters.AddWithValue("@DocumentName", ""); cmd.Parameters.AddWithValue("@DocumentType", checkAndGetValue(bRobject.DocumentType)); cmd.Parameters.AddWithValue("@PassportNo", ""); cmd.Parameters.AddWithValue("@FileContent", ""); cmd.Parameters.AddWithValue("@UserID", ""); cmd.Parameters.AddWithValue("@ModifyDate", ""); cmd.Parameters.AddWithValue("@Status", checkAndGetValue(bRobject.Status)); cmd.Parameters.AddWithValue("@NextAction", bRobject.nextAction); cmd.Parameters.AddWithValue("@IsActive", 1); cmd.Parameters.AddWithValue("@Custid", custid); cmd.Parameters.AddWithValue("@BnDType", checkAndGetValue(bRobject.BnDType)); cmd.Parameters.AddWithValue("@Msg", ""); result = cmd.ExecuteScalar().ToString(); string[] lines = result.Split('|'); authvalue = lines[0].Contains("Registered Successfully") ? 1 : 0; int BirthID = Convert.ToInt16(lines[1]); #endregion #region AuditTable result2 = AuditData.AduitFile.FillAudit(pageName, bRobject.CustomerName, authvalue); #endregion return(result); } catch (Exception ex) { ex.StackTrace.ToString(); return(result); } finally { con.Close(); } }
public string BirthDetails(BirthProcess bRobject) { con = Utility.Util.Connection("DBEntities"); string result = ""; string result2 = ""; //String orgType = ""; string pageName = "Birth Registration"; try { #region Birthregistration SqlCommand cmd = new SqlCommand("Tbl_BirthRegistration_SP", con); con.Open(); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Name_of_Informant", bRobject.initiatedBy); cmd.Parameters.AddWithValue("@Name_of_Child", bRobject.Name_of_Child); cmd.Parameters.AddWithValue("@Gender_Of_Child", bRobject.Gender_Of_Child); cmd.Parameters.AddWithValue("@Name_of_Father", bRobject.Name_of_Father); cmd.Parameters.AddWithValue("@Name_of_Mother", bRobject.Name_of_Mother); cmd.Parameters.AddWithValue("@Date_of_Birth", bRobject.Date_of_Birth); cmd.Parameters.AddWithValue("@Place_of_Birth", bRobject.Place_of_Birth); cmd.Parameters.AddWithValue("@Address", bRobject.Address); cmd.Parameters.AddWithValue("@Gram_Panchayat_Unit", bRobject.Gram_Panchayat_Unit); cmd.Parameters.AddWithValue("@Nationality", bRobject.Nationality); cmd.Parameters.AddWithValue("@City_name", ""); cmd.Parameters.AddWithValue("@DocumentType", bRobject.DocumentType); cmd.Parameters.AddWithValue("@FileName", bRobject.FileName); cmd.Parameters.AddWithValue("@DocumentName", bRobject.DocumentName); cmd.Parameters.AddWithValue("@PassportNo", ""); cmd.Parameters.AddWithValue("@FileContent", ""); cmd.Parameters.AddWithValue("@UserID", ""); cmd.Parameters.AddWithValue("@ModifyDate", ""); cmd.Parameters.AddWithValue("@Status", "Process"); cmd.Parameters.AddWithValue("@Level1", "0"); cmd.Parameters.AddWithValue("@Level2", "0"); cmd.Parameters.AddWithValue("@Level3", "0"); cmd.Parameters.AddWithValue("@IsActive", 0); cmd.Parameters.AddWithValue("@Msg", ""); result = cmd.ExecuteScalar().ToString(); int authvalue = result == "Register Successfully" ? 1 : 0; #endregion #region AuditTable result2 = AuditData.AduitFile.FillAudit(pageName, bRobject.Name_of_Informant, authvalue); #endregion return(result); } catch (Exception ex) { ex.StackTrace.ToString(); return(result); } finally { con.Close(); } }
public ActionResult Dashboard() { #region variabels string strTmp = null; string getAction_ID = null; string getAction = null; string UserPending = null; List <int> roleidlist = new List <int>(); List <RoleMap> RoleMapList = new List <RoleMap>(); #endregion #region Session variable int CustId = Convert.ToInt32(Session["Cust_ID"]); int UserToRole = Convert.ToInt16(Session["SortedList1"]); int Userrole = Convert.ToInt16(Session["U_ID"]); #endregion #region Objects RoleAction RoletoAction = new RoleAction(); BirthProcessAction objDB = new BirthProcessAction(); BirthProcess Bprocess = new BirthProcess(); #endregion RoletoAction.ShowRolltoAction = objDB.GetTbl_Action_MasterId(Userrole, 1); Session["RoleDesc"] = objDB.roleDesc; if (RoletoAction.ShowRolltoAction.Count == 0) { UserPending = objDB.GetAllUsersPending(Userrole); return(View("Dummy")); } UserPending = objDB.GetAllUsersPending(Userrole); TempData["Viewstr"] = strTmp; #region Differentiate Each role to Action foreach (RoleAction ActionRole in RoletoAction.ShowRolltoAction) { if (UserToRole == ActionRole.RoleId) { getAction_ID = ActionRole.ActionId.ToString(); getAction_ID = getAction_ID.Trim(); getAction = ActionRole.ActionDesc; } } #endregion Bprocess.ShowallBirthRegis = objDB.CountPending(getAction_ID, getAction, CustId); Session["ActionId"] = getAction_ID; Session["ActionName"] = getAction; Session["CustomerID"] = CustId; ActionID_Name = getAction + "|" + getAction_ID; if (Bprocess.ShowallBirthRegis == null) { return(View("Dummy")); } return(View(Bprocess)); }