public dynamic SaveSecretriatDatahel(SecretraintModel obj) { dynamic objupdate = new ExpandoObject(); try { string Status = SaveSecretriatData(obj); if (Status == "Success") { objupdate.Status = "100"; objupdate.Reason = "Your Record Updated Successfully"; } else { objupdate.Status = "102"; objupdate.Reason = "Data Not Submitted Please Try Again"; } } catch (Exception ex) { objupdate.Status = "102"; objupdate.Reason = ex.Message; } return(objupdate); }
public String SaveSecretriatData(SecretraintModel obj) { try { cmd = new OracleCommand(); cmd.CommandText = @"insert into gsws_secretariat_master (DISTRICT_CODE, DISTRICT_NAME, MANDAL_CODE, MANDAL_NAME, GP_CODE, GP_NAME, SECRETARIAT_CODE, SECRETARIAT_NAME, RURAL_URBAN) Values(:DISTRICT_CODE, :DISTRICT_NAME, :MANDAL_CODE, :MANDAL_NAME, :GP_CODE, :GP_NAME, :SECRETARIAT_CODE, :SECRETARIAT_NAME, :RURAL_URBAN)"; cmd.Parameters.Add(":DISTRICT_CODE", OracleDbType.Varchar2, 5).Value = obj.DISTRICTID; cmd.Parameters.Add(":DISTRICT_NAME", OracleDbType.Varchar2, 50).Value = obj.DISTRICTNAME; cmd.Parameters.Add(":MANDAL_CODE", OracleDbType.Varchar2, 5).Value = obj.MANDALID; cmd.Parameters.Add(":MANDAL_NAME", OracleDbType.Varchar2, 100).Value = obj.MANDALNAME; cmd.Parameters.Add(":GP_CODE", OracleDbType.Varchar2, 10).Value = obj.PANCHAYATID; cmd.Parameters.Add(":GP_NAME", OracleDbType.Varchar2, 200).Value = obj.PANCHAYATNAME; cmd.Parameters.Add(":SECRETARIAT_CODE", OracleDbType.Varchar2, 10).Value = obj.SECRETRIATID.Trim(); cmd.Parameters.Add(":SECRETARIAT_NAME", OracleDbType.Varchar2, 200).Value = obj.SECRETRIATNAME.Trim(); cmd.Parameters.Add(":RURAL_URBAN", OracleDbType.Varchar2, 500).Value = obj.RUFLAG; int k = getgswsExecuteNonQuery(cmd); if (k > 0) { return("Success"); } else { return("Failure"); } } catch (Exception ex) { string mappath = HttpContext.Current.Server.MapPath("ExceptionLogs"); Task WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_ReportLog_Exception(mappath, "Error UpdateUserManualURL :" + ex.Message.ToString())); throw ex; } }
public IHttpActionResult PostSecretriatData(dynamic data) { try { //string value = token_gen.Authorize_aesdecrpty(data); string value = JsonConvert.SerializeObject(data); string mappath = HttpContext.Current.Server.MapPath("PostSecretriatDataLogs"); Task WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_Log(mappath, value)); SecretraintModel rootobj = JsonConvert.DeserializeObject <SecretraintModel>(value); return(Ok(Internalhel.SaveSecretriatDatahel(rootobj))); } catch (Exception ex) { CatchData.Status = "Failure"; CatchData.Reason = ex.Message; return(Ok(CatchData)); } }