public JsonResult SaveDeclaration(int IsCheck, string Remark, string SocietyTransID)
        {
            int    i           = 0;
            bool   IsChecked   = false;
            string IPAddress   = GetIPAddress();
            string BrowserName = GetWebBrowserName();

            if (IsCheck == 1)
            {
                IsChecked = true;
            }
            if (IsCheck == 0)
            {
                IsChecked = false;
            }
            SaveDeclaration savedeclaration = new SaveDeclaration
            {
                UserId         = Convert.ToInt32(Session["UserId"]),
                IPAddress      = IPAddress,
                BrowserName    = BrowserName,
                Ischeck        = IsChecked,
                Remark         = Remark,
                SocietyTransID = SocietyTransID,
            };

            i = objARCSD.SaveDeclaration(savedeclaration);
            if (i >= 1)
            {
                return(Json(i.ToString(), JsonRequestBehavior.AllowGet));
            }
            return(Json("Something went wrong", JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public int SaveDeclaration(SaveDeclaration _savedeclaration)
        {
            int i;

            connection.Open();
            using (SqlConnection con = new SqlConnection(ConStr))
            {
                con.Open();
                SqlCommand cmd = new SqlCommand("[dbo].[Blog_SaveDeclaration]", connection)
                {
                    CommandType = CommandType.StoredProcedure
                };
                cmd.Parameters.AddWithValue("@SocietyTransID", _savedeclaration.SocietyTransID);
                cmd.Parameters.AddWithValue("@UserId", _savedeclaration.UserId);
                cmd.Parameters.AddWithValue("@Ischeck", _savedeclaration.Ischeck);
                cmd.Parameters.AddWithValue("@Remark", _savedeclaration.Remark);
                cmd.Parameters.AddWithValue("@IPAddress", _savedeclaration.IPAddress);
                cmd.Parameters.AddWithValue("@BrowserName", _savedeclaration.BrowserName);
                i = cmd.ExecuteNonQuery();
            }
            connection.Close();
            return(i);
        }
        public ActionResult BackLogMemberDetail(FormCollection fc)
        {
            try
            {
                int result = 0;
                List <SelectListItem> lstSL  = new List <SelectListItem>();
                List <SelectListItem> lstI   = new List <SelectListItem>();
                ARCSData            objARCSD = new ARCSData();
                InspectorData       objID    = new InspectorData();
                ForwardToIncepector objFTI   = new ForwardToIncepector();

                if (Convert.ToInt32(Session["RoleId"]) == 3)
                {
                    string IPAddress = GetIPAddress();
                    string Browser   = GetWebBrowserName();
                    ForwardToARCSOfficers objFTAO = new ForwardToARCSOfficers
                    {
                        IncepectorCode = Convert.ToInt32(Session["InsceptorCode"]),
                        SocietyTransId = Convert.ToString(Session["SocietyTransID"]),
                        Remarks        = fc.Get("ARCSRemarks").ToString()
                    };
                    if (Convert.ToInt16(Session["InspectorCount"]) >= 1)
                    {
                        Boolean         IsCheck         = Convert.ToBoolean(fc.Get("Insprctorchk1"));
                        SaveDeclaration savedeclaration = new SaveDeclaration
                        {
                            UserId         = Convert.ToInt32(Session["UserId"]),
                            IPAddress      = IPAddress,
                            BrowserName    = Browser,
                            Ischeck        = IsCheck,
                            Remark         = objFTAO.Remarks,
                            SocietyTransID = objFTAO.SocietyTransId,
                        };
                        objARCSD.SaveDeclaration(savedeclaration);
                    }
                    result = objID.BackLogForwardToARCS(objFTAO);
                    if (result >= 1)
                    {
                        if (Convert.ToInt32(Session["InspectorCount"]) > 1)
                        {
                            ViewBag.InspectorChange = "Yes";
                        }
                        ViewBag.show      = "BackLog Application successfully forwarded to ARCS Officer";
                        ViewBag.result    = "1";
                        ViewBag.tabResult = "1";
                    }
                    else
                    {
                        ViewBag.show      = "BackLog Application not successfully forwarded to ARCS Officer";
                        ViewBag.result    = "0";
                        ViewBag.tabResult = "0";
                    }
                    lstSL         = GetSocietyList();
                    ViewBag.lstSL = lstSL;
                }
                if (Convert.ToInt32(Session["RoleId"]) == 2)
                {
                    if (string.IsNullOrEmpty(fc.Get("IncepectorList")))
                    {
                        ViewBag.show      = "Kindly Select Inspector";
                        ViewBag.result    = "0";
                        ViewBag.tabResult = "5";
                        return(View());
                    }
                    if (string.IsNullOrEmpty(fc.Get("ARCSRemarks")))
                    {
                        ViewBag.show      = "fill your remarks";
                        ViewBag.result    = "0";
                        ViewBag.tabResult = "5";
                        return(View());
                    }
                    objFTI.OfficerCode = Convert.ToInt32(fc.Get("IncepectorList"));
                    var SocietyTransID = Convert.ToString(Session["SocietyTransID"]);
                    Session["SocietyTransID"] = SocietyTransID;
                    objFTI.SocietyTransId     = Convert.ToString(Session["SocietyTransID"]);
                    objFTI.Remarks            = fc.Get("ARCSRemarks").ToString();
                    result = objARCSD.BackLogForwardToIncepector(objFTI);
                    if (result >= 1)
                    {
                        ViewBag.show      = "Application successfully forwarded to incepector";
                        ViewBag.result    = "1";
                        ViewBag.tabResult = "1";
                    }
                    else
                    {
                        ViewBag.show      = "Application not successfully forwarded to incepector";
                        ViewBag.result    = "0";
                        ViewBag.tabResult = "0";
                    }
                    lstSL           = GetSocietyList();
                    ViewBag.lstSL   = lstSL;
                    lstI            = GetInspectorSocietyList();
                    ViewBag.BcklstI = lstI;
                }
                lstGD            = GetDistrict();
                ViewBag.District = lstGD;

                lstR = GetRelationship();
                ViewBag.Relationship          = lstR;
                lstMember                     = GetAllShareTransferMember();
                ViewBag.MemberDetail          = lstMember;
                lstMCDCM                      = GetMemberCommDesignation();
                ViewBag.MemberCommDesignation = lstMCDCM;
                lstARCSCode                   = GetsubClassSocieties();
                ViewBag.lstARCSCode           = lstARCSCode;
                CommunityofSociety            = GetCommunityofSociety();
                ViewBag.CommunityofSociety    = CommunityofSociety;
                lstSL          = GetSocietyList();
                ViewBag.lstSL  = lstSL;
                Inspkl         = GetInspectorSocietyList();
                ViewBag.Inspkl = Inspkl;
                lstI           = GetInspectorList();
                ViewBag.lstI   = lstI;
            }

            catch (Exception ex)
            {
                return(RedirectToAction("Error", "Unauthorised"));

                throw ex;
            }
            return(View());
        }