public DataSet SelectNewVillage(string DistrictId, ChkUser chk) { try { dataset = new DataSet(); if (connection != null && chk.username == "PPMS_02112012" && chk.password == "16112012") { connection.Open(); command = new SqlCommand(); //string qry = "select * from VillageMaster where District_Id='" + DistrictId + "' and Tehsil_ID='" + TehsilId + "' "; string qry = "select * from VillageMaster where District_Id='" + DistrictId + "' and VILLAGE_STATUS='N' "; command.CommandText = qry; command.Connection = connection; SqlDataAdapter dataAdapter = new SqlDataAdapter(command); dataAdapter.Fill(dataset); command.Dispose(); } } catch (Exception) { connection.Close(); } finally { connection.Close(); } return(dataset); }
public bool chkInformation(ChkUser userpwd) { bool rtev = false; if (userpwd != null) { //change on 16112012 //if (userpwd.username == "paddyservice30" && userpwd.password == "paddy2012") if (userpwd.username == "16112012" && userpwd.password == "16112012") { rtev = true; return(rtev); } } else { return(rtev); } return(rtev); }
public void InsertRunnerLog(string societyID, ChkUser userpwd) { try { if (connection != null && userpwd.username == "16112012" && userpwd.password == "16112012") { connection.Open(); string date = getDate_MDY(System.DateTime.Now.ToShortTimeString()); string LogID = societyID.ToString() + date; string LogIP = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"].ToString(); string LogDate = ""; string Pc_Id = societyID.ToString(); string District_Code = societyID.Substring(0, 4); string Society_Id = societyID.ToString(); string RunnerID = societyID.ToString(); string Status = "YES"; string RunnerVer = "3.0"; command = new SqlCommand(); string qry = "Insert Into RunnerLog(LogID,LogIP,LogDate,Pc_Id,District_Code,Society_Id,RunnerID,Status,RunnerVer)"; qry += " values('" + LogID + "','" + LogIP + "',getDate(),'" + Pc_Id + "','" + District_Code + "','" + Society_Id + "','" + RunnerID + "','" + Status + "','" + RunnerVer + "')"; command.CommandText = qry; command.Connection = connection; int ret = command.ExecuteNonQuery(); } } catch (Exception) { connection.Close(); } finally { connection.Close(); } }