コード例 #1
0
ファイル: HomeController.cs プロジェクト: usha105/FBISWebApi
        public IHttpActionResult ForwardSubmitRenewal(ForwardRenewal forward)
        {
            try
            {
                string host = Dns.GetHostName();
                string ip   = Dns.GetHostAddresses(host)[0].ToString();
                FbisLogger.Log("Method Entry", ip, System.Reflection.MethodBase.GetCurrentMethod().ToString(), this.Request.RequestUri.AbsoluteUri);

                Renewal re   = new Renewal();
                bool    flag = re.ForwardRenewalVerifier(forward);
                if (flag)
                {
                    JsonResponse json = new JsonResponse
                    {
                        Status    = "200 Ok",
                        StatusMsg = "Record Updated Successfully"
                    };
                    string  jo  = JsonConvert.SerializeObject(json).ToString();
                    JObject job = JObject.Parse(jo);
                    return(Ok(job));
                }
                else
                {
                    return(BadRequest());
                }
            }
            catch (Exception ex)
            {
                Log log = new Log();
                log.LogFile("Exception:" + ex.Message.ToString(), appRunningId);
                return(BadRequest());
            }
        }
コード例 #2
0
ファイル: Renewal.cs プロジェクト: usha105/FBISWebApi
        public bool ForwardRenewalVerifier(ForwardRenewal forward)
        {
            bool flag        = false;
            var  currentDate = DateTime.Now.ToString("dd/MM/yyyy");
            var  remarks     = currentDate + ": " + forward.Remarks;

            if (forward.Decision == "Reject")
            {
                flag = Convert.ToBoolean(dbOperation.DML("UpdateRenewalDtls", "SR", remarks, forward.Fac_Id));
            }
            else if (forward.Decision == "Approve")
            {
                flag = Convert.ToBoolean(dbOperation.DML("UpdateRenewalDtls", "SA", remarks, forward.Fac_Id));
            }
            else if (forward.Decision == "Seek")
            {
                flag = true;
            }
            return(flag);
        }