public int AddRecord(EventCFollowUpBLL objCFBLL) { int row; SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]); try { SqlParameter[] par = new SqlParameter[] { new SqlParameter("@CID", objCFBLL.CID1), new SqlParameter("@Date", objCFBLL.Date1), new SqlParameter("@Remark", objCFBLL.Remark1), new SqlParameter("@Status", objCFBLL.Status1), new SqlParameter("@CurrentDate", cc.DateFormatStatus()), new SqlParameter("@UserId", objCFBLL.UserId1), }; SqlCommand cmd = new SqlCommand("EventCFollowUpInsert", con); cmd.Parameters.AddRange(par); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(cmd); con.Open(); row = cmd.ExecuteNonQuery(); return(row); } catch (Exception ex) { throw ex; } finally { con.Close(); } }
protected void btnSubmit_Click(object sender, EventArgs e) { int result = 0; string sql = String.Empty; try { string dt = cc.DateFormatStatus(); if (btnSubmit.Text == "Submit") { if (ddltype.SelectedValue == "1") { sql = "insert into [Come2myCityDB].[come2mycity].[PWP_tblSportsNews]([PWP_NHeading],[PWP_NDetails],[PWP_NEntryDate],[PWP_NStatus]) values ('" + txtHeading.Text + "','" + txtDetails.Text + "','" + dt + "','1')"; } else if (ddltype.SelectedValue == "2") { sql = "insert into [Come2myCityDB].[come2mycity].[PWP_tblGameInfo]([PWP_GHeading],[PWP_GDetails],[PWP_GEntryDate],[PWP_GStatus]) values ('" + txtHeading.Text + "','" + txtDetails.Text + "','" + dt + "','1')"; } else if (ddltype.SelectedValue == "3") { sql = "insert into [Come2myCityDB].[come2mycity].[PWP_tblEvents]([PWP_EHeading],[PWP_EDetails],[PWP_EEntryDate],[PWP_EStatus]) values ('" + txtHeading.Text + "','" + txtDetails.Text + "','" + dt + "','1')"; } result = cc.ExecuteNonQuery(sql); if (result == 1) { ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Data saved successfully...!!!')", true); } } else if (btnSubmit.Text == "Modify") { if (ddltype.SelectedValue == "1") { sql = "update [Come2myCityDB].[come2mycity].[PWP_tblSportsNews] set [PWP_NHeading]='" + txtHeading.Text + "',[PWP_NDetails]='" + txtDetails.Text + "',[PWP_NEntryDate]='" + dt + "' where [PWP_NID]='" + lblId.Text + "' "; } else if (ddltype.SelectedValue == "2") { sql = "update [Come2myCityDB].[come2mycity].[PWP_tblGameInfo] set [PWP_GHeading]='" + txtHeading.Text + "',[PWP_GDetails]='" + txtDetails.Text + "',[PWP_GEntryDate]='" + dt + "' where [PWP_GID]='" + lblId.Text + "'"; } else if (ddltype.SelectedValue == "3") { sql = "update [Come2myCityDB].[come2mycity].[PWP_tblEvents] set [PWP_EHeading]='" + txtHeading.Text + "',[PWP_EDetails]='" + txtDetails.Text + "',[PWP_EEntryDate]='" + dt + "' where [PWP_EID]='" + lblId.Text + "'"; } result = cc.ExecuteNonQuery(sql); if (result == 1) { ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Data updated successfully...!!!')", true); } btnSubmit.Text = "Submit"; lblId.Text = ""; } clear(); LoadGrid(); } catch (Exception ex) { throw ex; } }
protected void btnSubmit_Click(object sender, EventArgs e) { string str1 = string.Empty; int row1; string dt = cc.DateFormatStatus(); string str2 = "insert into [Come2myCityDB].[come2mycity].[tbl_JWorkExp]([FrmDate],[ToDate],[TotalExpYr],[TotalExpM],[JTitle],[CompName],[Salary],[FArea],[UserId],[EntryDate])values('" + txtFrmdate.Text + "','" + txtTodate.Text + "','" + txtTExpYr.Text + "','" + txtWExpM.Text + "','" + txtJobT.Text + "','" + txtCompName.Text + "','" + txtSalary.Text + "','" + txtFArea.Text + "','" + Convert.ToString(Session["User"]) + "','" + dt + "')"; int row2 = cc.ExecuteNonQuery(str2); string str3 = "insert into [Come2myCityDB].[come2mycity].[tbl_JSkill]([Skill],[UserId])values('" + txtKeySkill.Text.Trim() + "'+'" + txtKeySkil2.Text.Trim() + "','" + Convert.ToString(Session["User"]) + "')"; int row3 = cc.ExecuteNonQuery(str3); uploadResume(); string s = Session["Resumefilename"].ToString(); string str4 = "insert into [Come2myCityDB].[come2mycity].[tbl_JProfile](RTitle,ResumeName,Course,UserId,EntryDate)values('" + txtRTitle.Text + "','" + s + "','" + txtCourse1.Text + "','" + Convert.ToString(Session["User"]) + "','" + dt + "')"; int row9 = cc.ExecuteNonQuery(str4); }
public int Updaterecord(EventMyctBLL EBLL) { int row; try { conn.Open(); using (SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"])) { SqlParameter[] par = new SqlParameter[] { new SqlParameter("@Id", EBLL.Id1), new SqlParameter("@BrideName", EBLL.BrideName1), new SqlParameter("@GroomName", EBLL.GroomName1), new SqlParameter("@InvitionFrom", EBLL.InvitionFrom1), new SqlParameter("@Date", EBLL.Date1), new SqlParameter("@Time", EBLL.Time1), new SqlParameter("@RemDate", EBLL.RemDate1), new SqlParameter("@RemTime", EBLL.RemTime1), new SqlParameter("@Location", EBLL.Location1), new SqlParameter("@PersonName", EBLL.PersonName1), new SqlParameter("@MobileNumber", EBLL.MobileNumber1), new SqlParameter("@PVisit", EBLL.PVisit1), new SqlParameter("@MyCt_UserId", EBLL.MyCt_UserId1), new SqlParameter("@MDescp", EBLL.MDescp1), new SqlParameter("@CurrentDate", cc.DateFormatStatus()), //new SqlParameter("@Status1",EBLL.Status3), //new SqlParameter("@Status2",EBLL.Status4), }; // par[13] = new SqlParameter("@MyCt_UserId", EBLL.MyCt_UserId1); //par[13] = new SqlParameter("@SendMgs", EBLL.SendMgs1); row = SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "sp_UEMyCt", par); } return(row); } catch (Exception ex) { throw ex; } finally { conn.Close(); } }
public int UpdateRecord(EventMeetingBLL SPMB) { int row; try { conn.Open(); using (SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"])) { SqlParameter[] par = new SqlParameter[] { new SqlParameter("@ID", SPMB.ID1), new SqlParameter("@ETitle", SPMB.ETitle1), new SqlParameter("@MeetingType", SPMB.MeetingType1), new SqlParameter("@Location", SPMB.Location1), new SqlParameter("@UptoTime", SPMB.UptoTime1), new SqlParameter("@UptoDate", SPMB.UptoDate1), new SqlParameter("@FrmDate", SPMB.FrmDate1), new SqlParameter("@FrmTime", SPMB.FrmTime1), new SqlParameter("@Descp", SPMB.Descp1), new SqlParameter("@RemDate", SPMB.RemDate1), new SqlParameter("@RemTime", SPMB.RemTime1), new SqlParameter("@RepRemainder", SPMB.RepRemainder1), new SqlParameter("@UserId", SPMB.UserId1), new SqlParameter("@CurrentDate", cc.DateFormatStatus()), }; row = SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "sp_UEMeetingCt", par); return(row); } } catch (Exception ex) { throw ex; } finally { conn.Close(); } }
//-------------------------------------------------------Update Record BirthdayEvent---------------------------------------------------------------- public int UpdateRecord(EventBirthDayBLL objEBDB) { int row; try { conn.Open(); using (SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"])) { SqlParameter[] par = new SqlParameter[] { new SqlParameter("@BID", objEBDB.BID1), new SqlParameter("@NameOfPerson", objEBDB.NameOfPerson1), new SqlParameter("@Birthdate", objEBDB.Birthdate1), new SqlParameter("@RemDate", objEBDB.RemDate1), new SqlParameter("@MobileNo", objEBDB.MobileNo1), new SqlParameter("@Time", objEBDB.Time1), new SqlParameter("@SMsg", objEBDB.SMsg1), new SqlParameter("@MDescp", objEBDB.MDescp1), new SqlParameter("@Gender", objEBDB.Gender1), new SqlParameter("@CurrentDate", cc.DateFormatStatus()), new SqlParameter("UserId", objEBDB.UserId1), }; row = SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "sp_UEBDay", par); return(row); } } catch (Exception ex) { throw ex; } finally { conn.Close(); } }
public int UpdateRecord(EventDeathBLL SPBL) { int row; try { conn.Open(); using (SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"])) { SqlParameter[] par = new SqlParameter[] { new SqlParameter("@DID", SPBL.DID1), new SqlParameter("@NameOfAccused", SPBL.NameOfAccused1), new SqlParameter("@Date", SPBL.Date1), new SqlParameter("@Time", SPBL.Time1), new SqlParameter("@Location", SPBL.Location1), new SqlParameter("@SDescp", SPBL.SDescp1), new SqlParameter("@Relative", SPBL.Relative1), new SqlParameter("@Relation", SPBL.Relation1), new SqlParameter("@PVisit", SPBL.PVisit1), new SqlParameter("@MDescp", SPBL.MDescp1), new SqlParameter("@UserId", SPBL.UserId1), new SqlParameter("@CurrentDate", cc.DateFormatStatus()), }; row = SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "sp_UEDeathct", par); return(row); } } catch (Exception ex) { throw ex; } finally { conn.Close(); } }
protected void btnSubmit_Click(object sender, EventArgs e) { string dt = cc.DateFormatStatus(); if (btnSubmit.Text == "Submit") { string sql; string imgstring = "0"; string folderPath; string ab = FileUpload1.FileName; folderPath = Server.MapPath("NewsFiles\\" + FileUpload1.FileName); if (FileUpload1.HasFile == true) { string path = ""; path = Server.MapPath("NewsFiles"); path = path + "\\" + FileUpload1.FileName; string fileExtension = System.IO.Path.GetExtension(FileUpload1.FileName).ToLower().Substring(1, 3); if (fileExtension == "jpeg" || fileExtension == "jpg" || fileExtension == "png" || fileExtension == "gif") { int imgLength = FileUpload1.PostedFile.ContentLength; byte[] imgcontent = new byte[imgLength]; HttpPostedFile file = FileUpload1.PostedFile; file.InputStream.Read(imgcontent, 0, imgLength); imgstring = Convert.ToBase64String(imgcontent, 0, imgLength); } if (File.Exists(path)) { File.Delete(path); FileUpload1.SaveAs(path); } else { FileUpload1.SaveAs(path); } //Response.Write("<script>alert('File Uploaded successfully')</script>"); } //else //{ // Response.Write("<script>alert('File format not recognised')</script>"); // ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('File format not recognised')", true); //} sql = "insert into [Come2myCityDB].[come2mycity].[tblShowNews] ([NHeading],[NTopic],[NPaper],[DONR],[LDOA],[NFeesApp],[NInDetail],[NAttachment],[NApplicablefor],[NState],[NDistrict],[NCity],[NFileName],[NCurrentDate],[NPrjname],[NImg],[status],[examid]) values" + "(N'" + txtNewsHeading.Text + "',N'" + ddlTopic.SelectedItem.Text + "',N'" + ddlNewsPaper.SelectedItem.Text + "',N'" + txtdtnewsRece.Text + "',N'" + txtDtApplication.Text + "',N'" + txtfees.Text + "',N'" + txtNewsDetail.Text + "',N'" + folderPath + "',N'" + rdoApplicablefor.SelectedItem.Text + "',N'" + ddlstate.SelectedValue + "',N'" + ddlDistrict.SelectedValue + "',N'" + ddlcity.SelectedValue + "',N'" + ab + "',N'" + dt + "',N'" + ddlprject.SelectedValue + "',N'" + imgstring + "','1',N'" + ddlexamIdName.SelectedValue + "')"; int status = cc.ExecuteNonQuery(sql); if (status == 1) { Response.Write("<script>alert('Record Inserted Successfully...!!!')</script>"); ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Inserted Successfully...!!!')", true); } } else if (btnSubmit.Text == "Modify") { string sql; sql = "update [Come2myCityDB].[come2mycity].[tblShowNews] set [NHeading]=N'" + txtNewsHeading.Text + "',[NTopic]=N'" + ddlTopic.SelectedItem.Text + "',[NPaper]=N'" + ddlNewsPaper.SelectedItem.Text + "',[LDOA]=N'" + txtDtApplication.Text + "',[NFeesApp]=N'" + txtfees.Text + "',[NInDetail]=N'" + txtNewsDetail.Text + "',[NApplicablefor]=N'" + rdoApplicablefor.SelectedItem.Text + "',[NPrjname]=N'" + ddlprject.SelectedValue + "',[NCurrentDate]=N'" + dt + "',[examid]=N'" + ddlexamIdName.SelectedValue + "' where NID=N'" + lblId.Text + "'"; int status = cc.ExecuteNonQuery(sql); if (status == 1) { Response.Write("<script>alert('Record Updated Successfully...!!!')</script>"); } btnSubmit.Text = "Submit"; lblId.Text = ""; ddlexamIdName.Visible = false; txtdtnewsRece.Enabled = true; } clear(); bindgvNews(); showId(); }
public string Registration(string AppMobileNo, string RefmobileNo, string strDevId, string strSimSerialNo, string keyword, string firstName, string lastName, string firmName, string address, string SchoolCode, string eMailId, string Role_Id, string pincode, string passcode, string latitude, string longitude, string state, string district, string Taluka, string userType, string DealerMobNo) { try { string str1 = string.Empty; string date = cc.DateFormatStatus(); keyword = keyword.ToUpper(); string getUserID = RegToUserMaster(AppMobileNo, firstName, lastName, address, pincode, strDevId); if (string.IsNullOrEmpty(getUserID)) { } else { str1 = RegToAllAppEzeeDrug(AppMobileNo, RefmobileNo, strDevId, strSimSerialNo, keyword, firstName, lastName, firmName, address, SchoolCode, eMailId, Role_Id, pincode, passcode, latitude, longitude, state, district, Taluka, userType, getUserID, date, DealerMobNo); string str = "select usrFirstName,usrLastName,usrMobileNo,usrAddress,usrPassword from UserMaster where usrUserId='" + getUserID + "'"; ds = cc.ExecuteDataset(str); if (keyword == "EZEETEST") { #region SendDataToEzeeTest //send Data To EzeeTest Database string fullName = ds.Tables[0].Rows[0]["usrFirstName"].ToString() + " " + ds.Tables[0].Rows[0]["usrLastName"].ToString(); string MobileNo = ds.Tables[0].Rows[0]["usrMobileNo"].ToString(); string Address = ds.Tables[0].Rows[0]["usrAddress"].ToString(); string Password = ds.Tables[0].Rows[0]["usrPassword"].ToString(); objeZeeTest.InsertEzeeTestRegistrationData(MobileNo, Password, fullName, Address); return("1"); #endregion } else if (keyword == "EZEESCHOOLAPP") { #region SendDataToEzeeSchool string FullName = firstName + " " + lastName; objSchoolData.SchoolAppRegistrationDetails(strDevId, strSimSerialNo, FullName, firmName, AppMobileNo, getUserID, Role_Id); #endregion } else if (keyword == "EZEESTORM") { #region SendDataToEzeeStorm string FullName = firstName + " " + lastName; objSchoolData.SchoolAppRegistrationDetails(strDevId, strSimSerialNo, FullName, firmName, AppMobileNo, getUserID, Role_Id); return("1"); #endregion } else if (keyword == "CLASSAPP") { #region SendDataToEzeeTest string Password = ds.Tables[0].Rows[0]["usrPassword"].ToString(); objclassapp.InsertClassAppDetailsToeZeeTest(firstName, lastName, firmName, AppMobileNo, Password, address, eMailId, Role_Id, RefmobileNo, strDevId); return("1"); #endregion } else if (keyword == "TRUEVOTER") { #region OTP For Role is '2' if (Role_Id == "2" || Role_Id == "3")//if Role Is '2'// { string otpEzee12 = "select OTP,[RefMobileNo],[RoleId],[MobileNo] from [Come2myCityDB].[dbo].[AllAppRegOTPForTrueVoter] where MobileNo='" + AppMobileNo + "' and Keyword='" + keyword + "'"; cmd.CommandText = otpEzee12; DataSet ds3 = cc.ExecuteDataset(otpEzee12); string mNo = string.Empty; string RefMNo1 = string.Empty; string RoleId1 = string.Empty; if (ds3.Tables[0].Rows.Count > 0) { mNo = Convert.ToString(ds3.Tables[0].Rows[0]["MobileNo"]); RefMNo1 = Convert.ToString(ds3.Tables[0].Rows[0]["RefMobileNo"]); RoleId1 = Convert.ToString(ds3.Tables[0].Rows[0]["RoleId"]); } if (ds3.Tables[0].Rows.Count == 0) { string myMobileNo = RefmobileNo; Random rand = new Random(); string otpstr = Convert.ToString(rand.Next(1001, 9999)); string OTPstr = otpstr; str1 = "Insert into [Come2myCityDB].[dbo].[AllAppRegOTPForTrueVoter]([IEMINo],[MobileNo],[Keyword],[OTP],[RefMobileNo],[RoleId],CurrentDate) values('" + strDevId + "','" + AppMobileNo + "','" + keyword + "','" + otpstr + "','" + RefmobileNo + "','" + Role_Id + "','" + DateTime.Now.Date.ToString("yyyy-MM-dd") + "')"; int result = cc.ExecuteNonQuery(str1); string passwordMessage = "Welcome , Mr. " + firstName + "(" + AppMobileNo + ")wants to join under you & his permission code is " + OTPstr + " share it " + cc.AddSMS(myMobileNo); int smslength = passwordMessage.Length; cc.TransactionalSMSCountry("OnlineExam", myMobileNo, passwordMessage, smslength, 22); return("1"); } else if (RefmobileNo != RefMNo1 && AppMobileNo.ToString() == mNo.ToString()) { string myMobileNo = RefmobileNo; Random rand = new Random(); string otpstr = Convert.ToString(rand.Next(1001, 9999)); string OTPstr = otpstr; str1 = "Update [Come2myCityDB].[dbo].[AllAppRegOTPForTrueVoter] set RefMobileNo='" + RefmobileNo + "',OTP='" + OTPstr + "' where MobileNo='" + AppMobileNo + "'"; int result = cc.ExecuteNonQuery(str1); string passwordMessage = "Welcome , Mr. " + firstName + "(" + AppMobileNo + ")wants to join under you & his permission code is " + OTPstr + " share it " + cc.AddSMS(myMobileNo); int smslength = passwordMessage.Length; cc.TransactionalSMSCountry("OnlineExam", myMobileNo, passwordMessage, smslength, 22); return("1"); } else if (RefmobileNo == RefMNo1 && AppMobileNo.ToString() == mNo.ToString()) { string myMobileNo = RefmobileNo; string sq = "select OTP from AllAppRegOTPForTrueVoter where RefMobileNo='" + RefMNo1 + "' and MobileNo='" + AppMobileNo + "'"; DataSet ds1 = cc.ExecuteDataset(sq); if (ds1.Tables[0].Rows.Count > 0) { string OTPstr = ds1.Tables[0].Rows[0]["OTP"].ToString(); if (OTPstr == null || OTPstr == "0" || OTPstr == "") { } else { string passwordMessage = "Welcome , Mr. " + firstName + "(" + AppMobileNo + ")wants to join under you & his permission code is " + OTPstr + " share it " + cc.AddSMS(myMobileNo); int smslength = passwordMessage.Length; cc.TransactionalSMSCountry("OnlineExam", myMobileNo, passwordMessage, smslength, 22); } } return("1"); } } else { return("1"); } #endregion } else if (keyword == "EZEEORDER") { #region SendDataToEzeeOder string Password = ds.Tables[0].Rows[0]["usrPassword"].ToString(); objEzeeOrder.Registration(getUserID, Password, firmName, userType, firstName, lastName, AppMobileNo, RefmobileNo, eMailId, address, RefmobileNo, pincode, state, district, Taluka, address, passcode, longitude, latitude, strDevId, strSimSerialNo, Role_Id); //remaining #endregion } //else //{ // return "1"; //} } return("1"); } catch (Exception ex) { string str = ex.Message; return(str); //return "0"; } //return "1"; }