Example #1
0
 public DataTable LoadDistricts_helper(DistrictsCls oj)
 {
     try
     {
         cmd = new OracleCommand();
         cmd.InitialLONGFetchSize = 1000;
         cmd.CommandType          = CommandType.StoredProcedure;
         cmd.CommandText          = "GSWS_GET_SERVICE_DETAILS";
         cmd.Parameters.Add("FTYPE", OracleDbType.Varchar2, 12).Value      = oj.TYPE;
         cmd.Parameters.Add("FDEPT_ID", OracleDbType.Varchar2, 12).Value   = oj.DEPARTMENT;
         cmd.Parameters.Add("FHOD_ID", OracleDbType.Varchar2, 12).Value    = oj.HOD;
         cmd.Parameters.Add("FDIST_CODE", OracleDbType.Varchar2, 12).Value = oj.DISTRICT;
         cmd.Parameters.Add("FMAND_CODE", OracleDbType.Varchar2, 12).Value = oj.MANDAL;
         cmd.Parameters.Add("FVILL_CODE", OracleDbType.Varchar2, 12).Value = oj.PANCHAYAT;
         cmd.Parameters.Add("P_URFLG", OracleDbType.Varchar2, 12).Value    = oj.RUFLAG;
         cmd.Parameters.Add("P_CUR", OracleDbType.RefCursor).Direction     = ParameterDirection.Output;
         DataTable dtstatus = GetgswsDataAdapter(cmd);
         if (dtstatus != null && dtstatus.Rows.Count > 0)
         {
             return(dtstatus);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         string mappath   = HttpContext.Current.Server.MapPath("BirthExceptionLogs");
         Task   WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_ReportLog_Exception(mappath, "Error From Load Districts Data :" + ex.Message.ToString()));
         throw ex;
     }
 }
Example #2
0
        public dynamic LoadDistricts(DistrictsCls oj)
        {
            dynamic      obj   = new ExpandoObject();
            PRRDSPHelper spobj = new PRRDSPHelper();

            try
            {
                DataTable dt = spobj.LoadDistricts_helper(oj);
                if (dt != null && dt.Rows.Count > 0)
                {
                    obj.Status  = 100;
                    obj.Reason  = "";
                    obj.Details = dt;
                }
                else
                {
                    obj.Status = 101;
                    obj.Reason = "No Data Found";
                }
            }
            catch (Exception ex)
            {
                obj.Status = 102;
                obj.Reason = "Error Occued While Loading Data";
                return(obj);
            }
            return(obj);
        }
        public IHttpActionResult LoadDistricts(dynamic data)
        {
            dynamic obj   = new ExpandoObject();
            string  value = token_gen.Authorize_aesdecrpty(data);

            try
            {
                //string value = JsonConvert.SerializeObject(data);
                DistrictsCls rootobj = JsonConvert.DeserializeObject <DistrictsCls>(value);
                return(Ok(hlpval.LoadDistricts(rootobj)));
            }
            catch (Exception ex)
            {
                obj.Status = 102;
                obj.Reason = "Error Occued While Loading Data";
                return(Ok(obj));
            }
        }