/// <summary> /// This Method is used to Delete data into tbl_category table /// </summary> /// <param name="objCategory">ID and Action</param> /// <returns>1 for success and -1 for fail</returns> public string Deletecountry(PropCountry objcountry, string userName) { if (userName != null && userName != "") { SqlCommand cmd = new SqlCommand("proc_country", objCon.Con); cmd.CommandType = CommandType.StoredProcedure; objCon.Con.Open(); try { cmd.Parameters.AddWithValue("@ID", objcountry.ID); cmd.Parameters.AddWithValue("@status", objcountry.Flag); cmd.Parameters.AddWithValue("@Action", "Delete"); return(cmd.ExecuteNonQuery().ToString()); } catch (Exception showError) { throw showError; } finally { cmd.Dispose(); objCon.Con.Close(); objCon.Con.Dispose(); } } else { return("Not Valid"); } }
/// <summary> /// This Method is used to Delete data /// </summary> /// <param name="objCountry">ID and Action</param> /// <returns>1 for success and -1 for fail</returns> public string RecordDelete(PropCountry objCountry, string UserName) { Dllcountry objDal = new Dllcountry(); try { return(objDal.Deletecountry(objCountry, UserName)); } catch (Exception info) { throw info; } finally { objDal = null; } }
/// <summary> /// This Method is used to Select data /// </summary> /// <param name="objCountry">Action</param> /// <returns>1 for success and -1 for fail</returns> public string RecordSelect(PropCountry objCountry) { Dllcountry objDal = new Dllcountry(); try { return(objDal.Selectcountry(objCountry)); } catch (Exception info) { throw info; } finally { objDal = null; } }
public string DeleteCountry(int ID, int Status) { string str = string.Empty; if (Session["admin"].ToString() != "" || Session["admin"].ToString() != null) { PropCountry proCountry = new PropCountry(); proCountry.ID = ID; proCountry.Flag = Status; BllCountry objCountry = new BllCountry(); str = objCountry.RecordDelete(proCountry, Session["admin"].ToString()); return(str); } else { return("Error in Authentication"); } }
public string UpdateCountry(string Name, int ID) { string str = string.Empty; if (Session["admin"].ToString() != "" || Session["admin"].ToString() != null) { PropCountry proCountry = new PropCountry(); proCountry.CountryName = Name; proCountry.ID = ID; BllCountry objCountry = new BllCountry(); str = objCountry.RecordUpdate(proCountry, Session["admin"].ToString()); return(str); } else { return("Error in Authentication"); } }
public string InsertCountry(string Country) { string str = string.Empty; if (Session["admin"].ToString() != "" || Session["admin"].ToString() != null) { PropCountry procountry = new PropCountry(); procountry.CountryName = Country; BllCountry objCountry = new BllCountry(); str = objCountry.RecordInsert(procountry, Session["admin"].ToString()); return(str); } else { return("Error in Authentication"); } }
/// <summary> /// This Method is used to Insert data /// </summary> /// <param name="objcountry">JobType,Category Name,</param> /// <returns>1 for success and -1 for fail</returns> public string RecordInsert(PropCountry objCountry, string UserName) { PropService p = new PropService(); Dllcountry objDal = new Dllcountry(); try { return(objDal.Insertcountry(objCountry, UserName)); } catch (Exception info) { throw info; } finally { objDal = null; } }
public string SelectCountry(int flag) { string str = string.Empty; //if (Session["admin"] != "" || Session["admin"].ToString() != null || Session["associate"] != "" || Session["associate"].ToString() != null) //{ PropCountry propCountry = new PropCountry(); propCountry.Flag = flag; BllCountry objCountry = new BllCountry(); // str = objCountry.RecordSelect(propCountry, Session["admin"].ToString()); str = objCountry.RecordSelect(propCountry); return(str); //} //else //{ // return "Error in Authentication"; //} }
/// <summary> /// This Method will be used to Post data into tbl_country table /// </summary> /// <param name="objsubCategory">CountryName</param> /// <returns>1 for success and -1 for fail</returns> public string Insertcountry(PropCountry objcountry, string userName) { if (userName != null && userName != "") { //proc_country is the stored procedure name which will be used to Insert data into the table SqlCommand cmd = new SqlCommand("proc_country", objCon.Con); cmd.CommandType = CommandType.StoredProcedure; if (objCon.Con.State == ConnectionState.Open) { } else { objCon.Con.Open(); } cmd.Parameters.AddWithValue("@Name", objcountry.CountryName); cmd.Parameters.AddWithValue("@Action", "Add"); return(cmd.ExecuteNonQuery().ToString()); } else { return("Not Valid"); } }
/// <summary> /// This Method is used to Select data from tbl_country table /// </summary> /// <param name="objCategory">Action</param> /// <returns>1 for success and -1 for fail</returns> public string Selectcountry(PropCountry objcountry) { SqlCommand cmd = new SqlCommand("proc_country", objCon.Con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Action", "View"); cmd.Parameters.AddWithValue("@status", objcountry.Flag); SqlDataAdapter adpt = new SqlDataAdapter(); DataSet ds = new DataSet(); if (objCon.Con.State == ConnectionState.Open) { } else { objCon.Con.Open(); } cmd.Connection = objCon.Con; adpt.SelectCommand = cmd; adpt.Fill(ds, "Countries"); objCon.Con.Close(); return(ds.GetXml()); }