public void Addexcel(string stateid, string districtid, string talukaid, string custMobNo, string F_Name, string L_Name, string M_Name, string type, string usrMobNo, string adminMobno) { try { SqlQry = "select [Cust_mobile] from [Come2myCityDB].[dbo].[EzeeMarketingCustDetails] where [Cust_mobile]='" + custMobNo + "'"; DataSet ds = cc.ExecuteDataset(SqlQry); if (ds.Tables[0].Rows.Count > 0) { SqlQry = "Update [Come2myCityDB].[dbo].[EzeeMarketingCustDetails] set [StateId]='" + stateid + "',[DistrictId]='" + districtid + "',[TalukaId]='" + talukaid + "',[Cust_mobile]='" + ds.Tables[0].Rows[0][0].ToString() + "'" + ",[FirstName]='" + F_Name + "',[LastName]='" + L_Name + "',[FirmName]='" + M_Name + "',[Type]='" + type + "',[AppMobNo]='" + usrMobNo + "',[AdminMobNo]='" + adminMobno + "' where [Cust_mobile]='" + ds.Tables[0].Rows[0][0].ToString() + "'"; cc.ExecuteNonQuery(SqlQry); } else { //SqlQry = "insert into [Come2myCityDB].[dbo].[EzeeMarketingReferenceCustomer] ([MobileNo],[AppMobNo],[CreatedBy],[CreatedDate])" + // "values('+91" + custMobNo + "','" + usrMobNo + "','" + usrMobNo + "','" + System.DateTime.Now.ToString("yyyy-MM-dd") + "')"; //cc.ExecuteNonQuery(SqlQry); //SqlQry = "select Max([CustId]) From [Come2myCityDB].[dbo].[EzeeMarketingReferenceCustomer]"; //string Custid = cc.ExecuteScalar(SqlQry); string str = " INSERT INTO [Come2myCityDB].[dbo].[EzeeMarketingCustDetails] " + " ([StateId],[DistrictId],[TalukaId],[Cust_mobile],[FirstName],[LastName],[FirmName],[Type],[AppMobNo],[AdminMobNo]) VALUES" + " (N'" + stateid + "',N'" + districtid + "',N'" + talukaid + "',N'" + custMobNo + "',N'" + F_Name + "',N'" + L_Name + "',N'" + M_Name + "',N'" + type + "',N'" + usrMobNo + "',N'" + adminMobno + "')"; cc.ExecuteNonQuery(str); } } catch { } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { if (txtDate.Text == "" || txtDate.Text == null) { Response.Write("<script>alert('please Select Date to Calender.....!')</script>"); } else { for (int i = 0; i < gvToday.Rows.Count; i++) { TextBox txtTime = (TextBox)gvToday.Rows[i].Cells[0].FindControl("txtTime"); TextBox txtRoomNo = (TextBox)gvToday.Rows[i].Cells[0].FindControl("txtRoomNo"); if (txtTime.Text == "" && txtRoomNo.Text == "") { string id1 = Convert.ToString(gvToday.Rows[i].Cells[0].Text); string Sql = "Update committeedetail set RoomNo='',TimeDetails='', EntryDate='" + txtDate.Text + "' where Id=" + id1 + ""; int k = cc.ExecuteNonQuery(Sql); } else { string id1 = Convert.ToString(gvToday.Rows[i].Cells[0].Text); // string RoomTime = Convert.ToString(txtRoomNo.Text) + Convert.ToString(txtTime.Text); string Sql = "Update committeedetail set RoomNo='" + txtRoomNo.Text + "' , TimeDetails='" + txtTime.Text + "' , EntryDate='" + txtDate.Text + "' where Id=" + id1 + ""; int k = cc.ExecuteNonQuery(Sql); } } Response.Write("<script>alert('Updated successfully.....!')</script>"); } } catch (Exception ex) { } }
protected void btn_save_Click(object sender, EventArgs e) { try { string Sql = "", GroupId = "", GroupName = ""; foreach (GridViewRow gr in gvgroup.Rows) { try { //lblGroupId Label lbl = (Label)gr.Cells[0].FindControl("lblGroupId"); GroupId = GroupId + "," + lbl.Text.ToString(); TextBox txt = (TextBox)gr.Cells[1].FindControl("txtGroupName"); GroupName = GroupName + "," + txt.Text.ToString(); } catch (Exception ex) { } } Sql = "Update UserMaster set GroupId='" + GroupId.Substring(1) + "',GroupName='" + GroupName.Substring(1) + "' " + " Where usrUserId='" + Convert.ToString(Session["User"]) + "' "; cc.ExecuteNonQuery(Sql); ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Group Updated Successfully')", true); } catch (Exception ex) { //throw ex; ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Group Not Updated')", true); } }
public void DayFlagUpdate(string lstUpdate) { string DalyFlag = "update userMaster set dCount=0"; int i = cc.ExecuteNonQuery(DalyFlag); Label1.Text = "Update of day flag."; lblLastUpdate.Text = "Last Update: " + lstUpdate.ToString(); }
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; } }
private void InsertBalanceTransfer() { string senderId = "myctin"; try { urBLL.Frmmobileno = "9422325020"; urBLL.Customermobileno = Convert.ToString(txtmobileno.Text); urBLL.Transbal = Convert.ToString(txttransaction.Text); urBLL.Prombal = Convert.ToString(txtPromotional.Text); urBLL.Validfrom = Convert.ToString(txtvalidfrom.Text); urBLL.Validupto = Convert.ToString(txtvalidupto.Text); status = urBLL.BLLInsertBalanceTransfer(urBLL); if (status == 1) { int Transactional = Convert.ToInt32(urBLL.Transbal); int Promtional = Convert.ToInt32(urBLL.Prombal); string mobileto = urBLL.Customermobileno; string query = "select * from usermaster where usrMobileNo='" + mobileto + "'"; DataSet dss = cc.ExecuteDataset(query); int SMSBal1 = Convert.ToInt32(dss.Tables[0].Rows[0]["SMSbal"]); int PaidCount1 = Convert.ToInt32(dss.Tables[0].Rows[0]["paidCount"]); SMSBal1 = SMSBal1 + Transactional; PaidCount1 = PaidCount1 + Promtional; string sql12 = "update usermaster set SMSbal='" + SMSBal1 + "' ,paidCount='" + PaidCount1 + "' where usrMobileNo='" + mobileto + "' "; int aaa = cc.ExecuteNonQuery(sql12); string messageto = "Dear user Your Transactional Bal is " + urBLL.Transbal + " & Promotional Bal is " + urBLL.Prombal + " updated successfully in ur a/c Thanks Via www.myct.in "; cc.SendMessageTra(senderId, mobileto, messageto); string sendto = "9422325020"; string sql = "select * from usermaster where usrMobileNo='" + sendto + "'"; DataSet ds = cc.ExecuteDataset(sql); int SMSBal = Convert.ToInt32(ds.Tables[0].Rows[0]["SMSbal"]); int PaidCount = Convert.ToInt32(ds.Tables[0].Rows[0]["paidCount"]); SMSBal = SMSBal - Transactional; PaidCount = PaidCount - Promtional; string sql1 = "update usermaster set SMSbal='" + SMSBal + "' ,paidCount='" + PaidCount + "' where usrMobileNo='" + sendto + "' "; int a = cc.ExecuteNonQuery(sql1); string message = "Dear user Trans Bal= " + urBLL.Transbal + " & Promo Bal=" + urBLL.Prombal + " is transfer to " + urBLL.Customermobileno + ""; string sms = message + " Your Trans Bal is " + SMSBal + " & Promo Bal is" + PaidCount + " Thanks Via www.myct.in"; cc.SendMessageTra(senderId, sendto, sms); //ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Balance Transfer successfully')", true); Response.Write("<script>alert('Balance Transfer successfully')</script>"); gvbalanceshow(); clearall(); } else { //ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Plz fill all information')", true); Response.Write("<script>alert('Plz fill all information')</script>"); } } catch (Exception ex) { } }
public void GetAbstract() { try { string Sql = "select UDISE_StudentPresenty.SchoolCode,EntryDate, SUM(RegBoys) as RegBoys,SUM(RegGirls)as RegGirls,SUM(Present_B)as Present_B,SUM(Present_G)as Present_G " + "from UDISE_StudentPresenty where UDISE_StudentPresenty.EntryDate='" + DateFormat + "' " + "GROUP BY EntryDate,SchoolCode"; ds = cc.ExecuteDataset(Sql); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { SchoolCode = Convert.ToString(ds.Tables[0].Rows[i]["SchoolCode"]); EntryDate = Convert.ToString(ds.Tables[0].Rows[i]["EntryDate"]); RegBoys = Convert.ToString(ds.Tables[0].Rows[i]["RegBoys"]); RegGirls = Convert.ToString(ds.Tables[0].Rows[i]["RegGirls"]); Present_B = Convert.ToString(ds.Tables[0].Rows[i]["Present_B"]); Present_G = Convert.ToString(ds.Tables[0].Rows[i]["Present_G"]); string AspPreSql = "Select EntryDate from UDISE_AbstractSchoolPresenty where SchoolCode='" + SchoolCode + "' and EntryDate='" + DateFormat + "'"; string ChkEntry = Convert.ToString(cc.ExecuteScalar(AspPreSql)); if (ChkEntry == "" || ChkEntry == null) { string AddStudPre = "Insert into UDISE_AbstractSchoolPresenty (SchoolCode,EntryDate,RegBoys,RegGirls,Present_B,Present_G)" + " values('" + SchoolCode + "','" + DateFormat + "','" + RegBoys + "','" + RegGirls + "','" + Present_B + "','" + Present_G + "')"; int a = cc.ExecuteNonQuery(AddStudPre); if (a == 1) { } } else { string ChkEntryPre = "Select Sum(RegBoys)as RegBoys,Sum(RegGirls)as RegGirls,Sum(Present_B)as Present_B,Sum(Present_G)as Present_G from UDISE_StudentPresenty where SchoolCode='" + SchoolCode + "' and EntryDate ='" + DateFormat + "'"; DataSet ds1 = cc.ExecuteDataset(ChkEntryPre); if (ds1.Tables[0].Rows.Count > 0) { string RegBoys1 = Convert.ToString(ds1.Tables[0].Rows[0]["RegBoys"]); string RegGirls1 = Convert.ToString(ds1.Tables[0].Rows[0]["RegGirls"]); string Present_B1 = Convert.ToString(ds1.Tables[0].Rows[0]["Present_B"]); string Present_G1 = Convert.ToString(ds1.Tables[0].Rows[0]["Present_G"]); string UpdateTotal = "Update UDISE_AbstractSchoolPresenty set RegBoys=" + RegBoys1 + " , RegGirls=" + RegGirls1 + ", Present_B=" + Present_B1 + ",Present_G=" + Present_G1 + "" + " where SchoolCode='" + SchoolCode + "' and EntryDate ='" + DateFormat + "'"; int b = cc.ExecuteNonQuery(UpdateTotal); if (b == 1) { } } } } ZeroAttendence(); } catch (Exception ex) { } }
public void CountryInsertUpdate() { countryBLLObj.countryName = Convert.ToString(txtCountryName.Text); string id = Convert.ToString(Session["MarketingUser"]); if (Convert.ToString(ViewState["countryId"]) == "") { status = countryBLLObj.BLLCountryInsert(countryBLLObj); if (status == 1) { Response.Write("<script>alert('Country Added')</script>"); string maxcntid = "select max(countryId) from CountryMaster"; string id1c = cc.ExecuteScalar(maxcntid); string dateins = DateTime.UtcNow.Date.ToShortDateString();// System.DateTime.Now.Date.ToString(); dateins = cc.ChangeDate(dateins); string insert = "update CountryMaster set insdate='" + dateins + "',userId='" + id + "' where countryId=" + id1c.ToString() + ""; cc.ExecuteNonQuery(insert); } else if (status == 0) { Response.Write("<script>alert('Country Not added')</script>"); } } else { countryBLLObj.countryId = Convert.ToInt32(Convert.ToString(ViewState["countryId"])); status = countryBLLObj.BLLCountryUpdate(countryBLLObj); if (status > 0) { Response.Write("<script>alert('Country Updated')</script>"); string cntid = Convert.ToString(ViewState["countryId"]); string dateupd = DateTime.UtcNow.Date.ToShortDateString(); dateupd = cc.ChangeDate(dateupd); string update = "update CountryMaster set modydate='" + dateupd + "',userId='" + id + "' where countryId=" + cntid.ToString() + ""; cc.ExecuteNonQuery(update); } else { Response.Write("<script>alertalert('Country Exist')</script>"); } } }
public int DALInsertMiscalRegistration(BALMiscalRegistration obj) { using (SqlConnection con = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"])) { try { string sql = "insert into MiscalFriends(userid,friendid,Groupno,FriendName)values('" + obj.Userid + "','" + obj.Friendid + "','" + obj.Groupno + "','" + obj.FriendName + "') "; status = cc.ExecuteNonQuery(sql); } catch (Exception ex) { } return(status); } }
protected void btnUploadFile_Click(object sender, EventArgs e) { HttpFileCollection uploadFilCol = Request.Files; for (int i = 0; i < uploadFilCol.Count; i++) { HttpPostedFile file = uploadFilCol[i]; string fileExt = Path.GetExtension(file.FileName).ToLower(); string fileName = Path.GetFileName(file.FileName); if (fileName != string.Empty) { try { if (fileExt == ".jpg" || fileExt == ".gif" || fileExt == ".bmp" || fileExt == ".jpeg" || fileExt == ".png" || fileExt == ".pdf" || fileExt == ".docx" || fileExt == ".mp3" || fileExt == ".mp4" || fileExt == ".3gp") { if (ddlUploadCenter.SelectedValue != "" || ddlUploadCenter.SelectedValue != null) { if (txtSubject.Text == "" || txtSubject.Text == null) { Response.Write("<script>alert('Please Enter The File....!')</script>"); } else { fileName = Convert.ToString(txtSubject.Text) + DateFormat.Replace('-', ' ') + fileExt; string Sql = "Select FileName from committeedetail where Id=" + ddlUploadCenter.SelectedValue + " and FileName='" + fileName + "'"; string FindFileName = Convert.ToString(cc.ExecuteScalar(Sql)); if (FindFileName != "") { FileInfo TheFile = new FileInfo(Server.MapPath("~/downloadfilesMLA/") + fileName); if (TheFile.Exists) { File.Delete(Server.MapPath("~/downloadfilesMLA/") + fileName); } } file.SaveAs(Server.MapPath("~/downloadfilesMLA/") + fileName); Sql = "Update committeedetail set FileName='" + fileName + "' where Id=" + ddlUploadCenter.SelectedValue + ""; int k = cc.ExecuteNonQuery(Sql); if (k == 1) { Response.Write("<script>alert('File Uploaded successfully')</script>"); LoadGrid(); Clear(); } else { Response.Write("<script>alert('File not Uploaded successfully')</script>"); } } } } } catch (Exception ex) { } } } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString)) { cmd.Connection = con; cmd.Parameters.AddWithValue("@FromSrNo", txtFromSrNo.Text.ToString()); cmd.Parameters.AddWithValue("@ToSrNo", txtToSrNo.Text.ToString()); cmd.CommandText = "spGetDistributeCode"; cmd.CommandType = CommandType.StoredProcedure; da.SelectCommand = cmd; da.Fill(ds); DateTime currentdate = System.DateTime.Now; DateTime datetime = currentdate.AddDays(30); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { sql = "Update [tblScratchcodeTV] set [CodeFor]='" + ddlCodeFor.SelectedValue.ToString() + "',[CodeForName]='" + ddlCodeFor.SelectedItem.Text.ToString() + "',[referenceMobNo]='" + txtAdminMobNo.Text.ToString() + "', " + " [RefAddedDate]='" + currentdate.ToString() + "',[ExpireDate]='" + datetime.ToString("dd/MM/yyyy hh:mm:ss tt") + "',[ProjectName]='" + ddlProjectName.SelectedValue + "',[Amount]='" + txtAmount.Text + "' " + " where SrNo='" + ds.Tables[0].Rows[i]["SrNo"].ToString() + "'"; cc.ExecuteNonQuery(sql); } } ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "anything", "alert('Data Saved Sucessfully');", true); BindGvDistributeCode(); } catch (Exception) { lblError.Visible = true; lblError.Text = "Oops Error!"; } }
public string registerApp(string IMEINO, string SimSerialNo, string firstName, string lastName, string purpose, string RefNcpMobileNo, string EmergencyMobileNo_1, string EmergencyMobileNo_2, string EmergencyMobileNo_3, string address, string state, string district, string eMailId, string pincode, string passcode, string latitude, string longitude, string appType) { try { string sql = " insert into EmergencyAppReg ( IMEINO, SimSerialNo, firstName, lastName, purpose, RefNcpMobileNo, EmergencyMobileNo_1," + " EmergencyMobileNo_2, EmergencyMobileNo_3, address, state, district, eMailId, pincode, passcode, latitude, longitude, appType) " + " values(" + IMEINO + "," + SimSerialNo + ",'" + firstName + "','" + lastName + "','" + purpose + "'," + RefNcpMobileNo + "," + EmergencyMobileNo_1 + "," + EmergencyMobileNo_2 + "," + EmergencyMobileNo_3 + ",'" + address + "'," + state + "," + district + ",'" + eMailId + "'," + pincode + "," + passcode + "," + latitude + "," + longitude + ",'" + appType + "') "; string k = Convert.ToString(cc.ExecuteNonQuery(sql)); return(k); } catch (Exception ex) { return("0"); } finally { } }
public void SortVoiceCallInfo(string VoiceInfo) { // {"smscresponse":{"calluid":"d4214e84-3edc-4948-859b-90355a364862-1386839045o","to":"9028681018","dnd_numbers":"","callstatus":"received","event":"newcall","direction":"outbound"}} // string AllString = "smscresponse:calluid:d4214e84-3edc-4948-859b-90355a364862-1386839045o,to:9028681018,dnd_numbers:,callstatus:received,event:newcall,direction:outbound"; string[] wholestr = VoiceInfo.Trim().Split(','); string Calluid = wholestr[0].ToString(); string RecivedMobNo = wholestr[1].ToString(); string Dnd = wholestr[2].ToString(); string CallStatus = wholestr[3].ToString(); string Eventstr = wholestr[4].ToString(); string Direction = wholestr[5].ToString(); string[] Calluid1 = Calluid.Split(':'); string[] RecivedMobNo1 = RecivedMobNo.Split(':'); string[] Dnd1 = Dnd.Split(':'); string[] CallStatus1 = CallStatus.Split(':'); string[] Eventstr1 = Eventstr.Split(':'); string[] Direction1 = Direction.Split(':'); string Sql = "Insert Into VoiceCallAllReport(SIMNO,IMEINO,VoiceMobileNo,ReciverMobileNo,CallWAV,calluid,callstatus,event,direction,dnd_numbers,Error,EntryDate,SmsCountryString)" + "values('45236589562365545445','45269336522552','7852369852','" + RecivedMobNo1[1].ToString() + "','SSS','" + Calluid1[2].ToString() + "','" + CallStatus1[1].ToString() + "','" + Eventstr1[1].ToString() + "','" + Direction1[1].ToString() + "','" + Dnd1[1].ToString() + "','Error','" + DateFormat + "','" + VoiceInfo + "')"; int i = cc.ExecuteNonQuery(Sql); }
protected void btnSubmit_Click(object sender, EventArgs e) { string sql = ""; string UserId = Convert.ToString(ViewState["User"]); if (UserId == "") { lblError.Visible = true; lblError.Text = " This Mobile no is not exist."; } else { foreach (ListItem lst in lstConsumer.Items) { string id = lst.Value.ToString(); sql = sql + " Insert into MarketingRecord( UserId, MarketingId, RecordDate,Type) Values " + " ('" + UserId + "','" + Session["User"] + "','" + System.DateTime.Now + "','C' ) "; sql = sql + " Insert into UserConsumer (UserId,ConsumerNo) Values ('" + UserId + "','" + id + "' )"; } try { int flag = cc.ExecuteNonQuery(sql); ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Consumer No Added')", true); Response.Redirect("AddConsumer.aspx"); } catch { } ViewState["User"] = ""; } }
private void AddNew() { CommonCode cc = new CommonCode(); try { if (txtRoleName.Text == "") { lblError.Visible = true; lblError.Text = "Please Enter the Role Name"; ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Please Enter the Role Name')", true); } else { string Sql = "Select Roleid from [Come2myCityDB].[come2mycity].submenuPermission where RoleName='" + txtRoleName.Text.ToString() + "'"; string Id = Convert.ToString(cc.ExecuteScalar(Sql)); if (!(Id == null || Id == "")) { lblError.Visible = true; lblError.Text = "This Name is already exist"; ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('This Name is already exist')", true); lblError.Text = ""; } else { string sql11 = "select roleid,referencerole from [Come2myCityDB].[come2mycity].submenuPermission where rolename='" + ddlRole.SelectedItem.Text + "' "; DataSet ds = cc.ExecuteDataset(sql11); string refrole = Convert.ToString(ds.Tables[0].Rows[0]["referencerole"]); if (refrole == "") { string roleid = Convert.ToString(ds.Tables[0].Rows[0]["roleid"]); refrole = roleid; } if (ddlRole.SelectedValue == "0") { refrole = ""; } Sql = "Insert into [Come2myCityDB].[come2mycity].submenuPermission(RoleName,RoleDescription,PageAccessPerm,UnderRole,referencerole) Values ('" + txtRoleName.Text.ToString() + "','" + txtRoleName.Text.ToString() + "','','" + ddlRole.SelectedValue + "','" + refrole.ToString() + "') "; int flag = cc.ExecuteNonQuery(Sql); txtRoleName.Text = ""; txtRoleDescription.Text = ""; lblError.Visible = true; getinfo(); lblError.Text = "Role Added Successfully"; lblError.Visible = false; ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Role added successfully')", true); getRole(); getinfo(); } } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Role not added')", true); } }
private void fileDownload(string fileName, string fileUrl, string id) { Page.Response.Clear(); bool success = ResponseFile(Page.Request, Page.Response, fileName, fileUrl, 1024000); if (!success) { Response.Write("Downloading Error!"); } else { string sql = "update VisitorIPDetails set status=1 where VisitorId='" + id + "'"; int a = cc.ExecuteNonQuery(sql); } // Page.Response.End(); }
protected void btnDataTransfer_Click(object sender, EventArgs e) { try { string chkContact = "chkSelectMessage"; ArrayList selecteItem = GetCheckedItems(chkContact, gvLongCodeSMS); if (selecteItem.Count > 0) { foreach (string id in selecteItem) { string sql = "select * from come2mycity.test where pk='" + id + "'"; DataSet ds = cc.ExecuteDataset(sql); string message = Convert.ToString(ds.Tables[0].Rows[0]["Message"]); string mobile = Convert.ToString(ds.Tables[0].Rows[0]["mobile"]); string shortcode = Convert.ToString(ds.Tables[0].Rows[0]["shortcode"]); string FlagStatus = Convert.ToString(ds.Tables[0].Rows[0]["smsStatus"]); string PK = Convert.ToString(ds.Tables[0].Rows[0]["PK"]); string SendDate = Convert.ToString(ds.Tables[0].Rows[0]["SendDate"]); sql = "insert into uvajagar(PK,Message,Mobile,smsStatus,SendDate)" + "values('" + PK + "','" + message + "','" + mobile + "','" + FlagStatus + "','" + SendDate + "')"; int a = cc.ExecuteNonQuery(sql); } } else { Response.Write("<script>(alert)('Plz select atleast one')</script>"); loadGvLongCodeSMSReceve(); } } catch (Exception ex) { } }
protected void gvLongCodeSMS_RowUpdating(object sender, GridViewUpdateEventArgs e) { CommonCode cc = new CommonCode(); TextBox txtNewMsgUpdate = (TextBox)gvLongCodeSMS.Rows[e.RowIndex].FindControl("txtMsg"); Label lblIdText = (Label)gvLongCodeSMS.Rows[e.RowIndex].FindControl("lblID"); Label lblMobile = (Label)gvLongCodeSMS.Rows[e.RowIndex].FindControl("lblMobile"); Label DateProper = (Label)gvLongCodeSMS.Rows[e.RowIndex].FindControl("lblDate"); Datelast = Convert.ToString(DateProper.Text); DateTime today = DateTime.Now.Date; string id = ""; string msm = ""; string mobileNo = ""; id = lblIdText.Text; msm = txtNewMsgUpdate.Text; mobileNo = "91" + lblMobile.Text; string sqlPush = "update come2mycity.test set FlagStatus = 0 where PK = " + id.ToString() + ""; int F = cc.ExecuteNonQuery(sqlPush); loadGvLongCodeSMSReceve(); string URL = "http://www.come2mycity.com/sendMsg.aspx?message=" + Convert.ToString(msm) + "&mobilenumber=" + Convert.ToString(mobileNo) + "&receivedon=" + Convert.ToString(Datelast) + ""; Response.Redirect(URL); }
protected void Page_Load(object sender, EventArgs e) { //Response.ContentType = "image/jpg"; string strMyUrl = System.Web.HttpContext.Current.Request.Url.ToString(); // string strMyUrl = "http://www.myct.in/SMT/down.aspx?af4"; // string fetchsql = "select usr_url from frienddownloadlink where frnd_url='" + strMyUrl + "'"; // string a = cc.ExecuteScalar(fetchsql); string fetchsql2 = "select folderuserid,actual_filename from uploaddetails where url='" + strMyUrl + "' "; DataSet ds = cc.ExecuteDataset(fetchsql2); string foldername = Convert.ToString(ds.Tables[0].Rows[0]["folderuserid"]); string actualfname = Convert.ToString(ds.Tables[0].Rows[0]["actual_filename"]); string[] newurl = strMyUrl.Split('?'); string firsturl = newurl[0]; string userResource = "User_Resource/"; firsturl = firsturl + userResource + newurl[1]; DirectoryInfo di = new DirectoryInfo(Server.MapPath("~/User_Resource/" + foldername + ("/"))); string s6 = Server.MapPath(""); int i = 0; foreach (FileInfo fi in di.GetFiles()) { //if (System.IO.Path.GetExtension(di.Name).ToLower() != ".mp3" && System.IO.Path.GetExtension(di.Name).ToLower() != ".flv" && System.IO.Path.GetExtension(di.Name).ToLower() != ".avi" && System.IO.Path.GetExtension(di.Name).ToLower() != ".xlsx" && System.IO.Path.GetExtension(di.Name).ToLower() != ".pdf" && System.IO.Path.GetExtension(di.Name).ToLower() != ".jpg" && System.IO.Path.GetExtension(di.Name).ToLower() != ".png" && System.IO.Path.GetExtension(di.Name).ToLower() != ".gif" && System.IO.Path.GetExtension(di.Name).ToLower() != ".jpeg") if (System.IO.Path.GetExtension(di.Name).ToLower() != ".wav" && System.IO.Path.GetExtension(di.Name).ToLower() != ".mp4" && System.IO.Path.GetExtension(di.Name).ToLower() != ".txt" && System.IO.Path.GetExtension(di.Name).ToLower() != ".doc" && System.IO.Path.GetExtension(di.Name).ToLower() != ".xlsx" && System.IO.Path.GetExtension(di.Name).ToLower() != ".mp3" && System.IO.Path.GetExtension(di.Name).ToLower() != ".flv" && System.IO.Path.GetExtension(di.Name).ToLower() != ".avi" && System.IO.Path.GetExtension(di.Name).ToLower() != ".xls" && System.IO.Path.GetExtension(di.Name).ToLower() != ".pdf" && System.IO.Path.GetExtension(di.Name).ToLower() != ".jpg" && System.IO.Path.GetExtension(di.Name).ToLower() != ".png" && System.IO.Path.GetExtension(di.Name).ToLower() != ".gif" && System.IO.Path.GetExtension(di.Name).ToLower() != ".jpeg" && System.IO.Path.GetExtension(di.Name).ToLower() != ".csv") { string Sql = "insert into DownloadFile_Details(FileLink)values('" + di.FullName + "')"; ds = cc.ExecuteDataset(Sql); if (fi.Name == actualfname) { string sqlshow = "select flag from frienddownloadlink where frnd_url='" + strMyUrl + "'"; string check = cc.ExecuteScalar(sqlshow); //if (check == "Active") // { fileDownload(fi.Name, di.FullName + fi.Name); string updatequery = "update frienddownloadlink set flag='Deactive' where frnd_url='" + strMyUrl + "'"; int deac = cc.ExecuteNonQuery(updatequery); // } // else // { // Label1.Visible = true; // Label1.Text = "You have already downloaded this file !!"; //Response.Write("You have already downloaded this file"); // } } //fileDownload(fi.Name, Server.MapPath("~/User_Resource/02db0deb-c7b9-4843-ae4e-5d59834af43b/" + fi.Name)); } } }
private void InsertKeyword() { try { string userid = Session["MarketingUser"].ToString(); string sql = "select IMEINO,Sim_no from LongCodeRegistration where UsrUserid='" + userid + "'"; DataSet ds = cc.ExecuteDataset(sql); keywordBLLObj.IMEINO = Convert.ToString(ds.Tables[0].Rows[0]["IMEINO"]); keywordBLLObj.Simno = Convert.ToString(ds.Tables[0].Rows[0]["Sim_no"]); string date = DateTime.Today.ToShortDateString(); date = cc.DTInsert_Local(date); keywordBLLObj.keywordCreationDate = date; keywordBLLObj.keywordName = Convert.ToString(txtKeywordName.Text.ToUpperInvariant()); keywordBLLObj.keywordDescription = Convert.ToString(txtKeywordDescription.Text); keywordBLLObj.responseMsg = Convert.ToString(txtResponseMessage.Text); keywordBLLObj.Email = Convert.ToString(txtEmail.Text); keywordBLLObj.keyEmailSub = Convert.ToString(txtEmailSub.Text.Trim()); keywordBLLObj.Fwdmobileno = Convert.ToString(txtFwdMobileno.Text); keywordBLLObj.Keywordfor = Convert.ToString(ddlkeyword.SelectedItem.Value); string keywordstatus = "Active"; keywordBLLObj.Keywordstatus = keywordstatus; status = keywordBLLObj.BLLMiscalKeywordIsExist(keywordBLLObj); if (status > 0) { status = keywordBLLObj.BLLMiscalKeywordInsert(keywordBLLObj); if (status > 0) { ////////Comment for sumtime becz it is in progress if (ddlkeyword.SelectedItem.Value == "2") { listitem(); sql = "select Id from PersonalLongCodekeywords where keywordName='" + keywordBLLObj.keywordName + "' and IMEINO='" + keywordBLLObj.IMEINO + "' and simno='" + keywordBLLObj.Simno + "'"; string id = cc.ExecuteScalar(sql); sql = "insert into RegistrationKeyword(Pid,RegNo)values('" + id + "','" + choice + "')"; int a = cc.ExecuteNonQuery(sql); } //////////////////////////////////////// LoadKeyword(); clearItems(); Response.Write("<script>alert('Keyword Added successfully')</script>"); ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Keyword Added successfully')", true); } } else { Response.Write("<script>alert('Keyword Added successfully')</script>"); ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Keyword Name Already Exist ')", true); clearItems(); } } catch (Exception ex) { string msg = ex.Message; } }
protected void btnSubmit_Click(object sender, EventArgs e) { string name = txtName.Text; DateTime date = DateTime.Now; date = date.AddHours(9); date = date.AddMinutes(90); string todaysDate = date.ToString(); string sql = "insert into demotime(name,localdate)values('" + name + "','" + todaysDate + "')"; int a = cc.ExecuteNonQuery(sql); }
public void addrecord() { string str1 = "select ID from [Come2myCityDB].[dbo].[tbl_Sub_ID] where Name='" + ddlEvent.SelectedValue.ToString() + "'"; string s = cc.ExecuteScalar(str1); string str = "insert into [Come2myCityDB].[dbo].[tbl_Main_ID](Sub_ID,Name,UserId)values('" + s + "','" + txtCombo.Text + "','" + Convert.ToString(Session["User"]) + "')"; int result = cc.ExecuteNonQuery(str); if (result == 1) { ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Event Added Successfully')", true); } }
//----------------------------------------------------------------------------Add Link DownLoad Pc Details protected void Addvisitor() { try { string sql = "insert into VisitorIPDetails(HostName,VisitDateTime,IPAdd,RequestURL)" + "values('" + hostName + "','" + DateTime.Now.ToString() + "','" + ipAddress + "','" + Request.Url.ToString() + "')"; int k = cc.ExecuteNonQuery(sql); } catch (Exception ex) { } }
public string insertForumData(string data) { List <forumdata> lifdata = new JavaScriptSerializer().Deserialize <List <forumdata> >(data); foreach (forumdata fdata in lifdata) { string sql = "insert into [Come2myCityDB].[come2mycity].[tblChatForum]([MobileNo],[RegId]) values('" + fdata.mobileno + "','" + fdata.regid + "')"; cc.ExecuteNonQuery(sql); } return("1"); }
public void txtChange(DropDownList ddl, TextBox tb) { string str1 = "select ID,Name from [Come2myCityDB].[dbo].[tbl_Main_ID] where Sub_ID='3'"; DataSet ds = new DataSet(); ds = cc.ExecuteDataset(str1); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { if (Convert.ToString(txtCType.Text) == Convert.ToString(ds.Tables[0].Rows[i]["Name"])) { ViewState["abc"] = txtCType.Text; } } if (Convert.ToString(txtCType.Text) == Convert.ToString(ViewState["abc"])) { ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Already present')", true); DDLCType.Visible = true; txtCType.Visible = false; } else { string ss = txtCType.Text.ToUpper(); string str = "insert into [Come2myCityDB].[dbo].[tbl_Main_ID](Sub_ID,Name,UserId,AdminUserId)values('3','" + ss + "','" + Convert.ToString(Session["User"]) + "','0')"; int row = cc.ExecuteNonQuery(str); DDLCType.DataSource = ds; DDLCType.DataTextField = "Name"; DDLCType.DataValueField = "ID"; DDLCType.DataBind(); DDLCType.Items.Insert(0, new ListItem("Select", "0")); DDLCType.SelectedIndex = 0; ddl.Visible = true; tb.Visible = false; } }
public int AddEvent(string IMEINo, string SimNo, string NameEvent, string DateofMessage, string time, string Location, string SocialDscrip, string Ralative, string Relation, string Visit, string SendMgs, string DateFormat, string CreatedBy, string UserId) { try { if (IMEINo == "0" && SimNo == "0") { string Sql = "Insert into CreateMyctEvent(usrUserId,EventName,DateofMessage,time1,Location,SocialDscrip,Ralative,Relation,Visit,SendMgs,EntryDate,Createby,IMEINo,SIMNo) " + " values('" + UserId + "','" + NameEvent + "','" + Convert.ToDateTime(DateofMessage) + "','" + time + "','" + Location + "','" + SocialDscrip + "','" + Ralative + "','" + Relation + "','" + Visit + "','" + SendMgs + "','" + Convert.ToDateTime(DateFormat) + "','" + CreatedBy + "','" + IMEINo + "','" + SimNo + "')"; k = cc.ExecuteNonQuery(Sql); if (k == 1) { } } else { string mobileNo = verifymobile(IMEINo, SimNo); if (!String.IsNullOrEmpty(mobileNo)) { string sqlget = "select usrUserid from usermaster where usrMobileNo='" + mobileNo + "'"; string getuserID = cc.ExecuteScalar(sqlget); if (!String.IsNullOrEmpty(getuserID)) { string Sql = "Insert into CreateMyctEvent(usrUserId,EventName,DateofMessage,time1,Location,SocialDscrip,Ralative,Relation,Visit,SendMgs,EntryDate,Createby,IMEINo,SIMNo) " + " values('" + UserId + "','" + NameEvent + "','" + DateofMessage + "','" + time + "','" + Location + "','" + SocialDscrip + "','" + Ralative + "','" + Relation + "','" + Visit + "','" + SendMgs + "','" + DateFormat + "','" + CreatedBy + "','" + IMEINo + "','" + SimNo + "')"; k = cc.ExecuteNonQuery(Sql); if (k == 1) { } } } } } catch (Exception ex) { } finally { } return(k); }
protected void Button1_Click(object sender, EventArgs e) { UserId = Convert.ToString(Session["User"]); if (gr1.ToString() != "" || gr2.ToString() != "" || gr3.ToString() != "" || gr4.ToString() != "" || gr5.ToString() != "") { string sqlUpdate = "update tblPaidSmsGroup"; sqlUpdate += " set GrName=case GrName"; sqlUpdate += " when '" + gr1.ToString() + "' then '" + txtGrFirst.Text.ToString() + "'"; sqlUpdate += " when '" + gr2.ToString() + "' then '" + txtGrSecond.Text.ToString() + "'"; sqlUpdate += " when '" + gr3.ToString() + "' then '" + txtGrThird.Text.ToString() + "'"; sqlUpdate += " when '" + gr4.ToString() + "' then '" + txtGrFourth.Text.ToString() + "'"; sqlUpdate += " when '" + gr5.ToString() + "' then '" + txtGrFive.Text.ToString() + "'"; sqlUpdate += " End "; sqlUpdate += " where UserId='" + UserId.ToString() + "'"; int I = cc.ExecuteNonQuery(sqlUpdate); } else if (txtGrFirst.Text != "" && txtGrSecond.Text != "" && txtGrThird.Text != "" && txtGrFourth.Text != "" && txtGrFive.Text != "") { if (txtGrFirst.Text.ToString() != "") { string sqlU = "insert into tblPaidSmsGroup(UserID,GrName)"; sqlU += " values('" + UserId.ToString() + "','" + txtGrFirst.Text.ToString() + "')"; int i = cc.ExecuteNonQuery(sqlU); } if (txtGrSecond.Text.ToString() != "") { string sqlU = "insert into tblPaidSmsGroup(UserID,GrName)"; sqlU += " values('" + UserId.ToString() + "','" + txtGrSecond.Text.ToString() + "')"; int i = cc.ExecuteNonQuery(sqlU); } if (txtGrThird.Text.ToString() != "") { string sqlU = "insert into tblPaidSmsGroup(UserID,GrName)"; sqlU += " values('" + UserId.ToString() + "','" + txtGrThird.Text.ToString() + "')"; int i = cc.ExecuteNonQuery(sqlU); } if (txtGrFourth.Text.ToString() != "") { string sqlU = "insert into tblPaidSmsGroup(UserID,GrName)"; sqlU += " values('" + UserId.ToString() + "','" + txtGrFourth.Text.ToString() + "')"; int i = cc.ExecuteNonQuery(sqlU); } if (txtGrFive.Text.ToString() != "") { string sqlU = "insert into tblPaidSmsGroup(UserID,GrName)"; sqlU += " values('" + UserId.ToString() + "','" + txtGrFive.Text.ToString() + "')"; int i = cc.ExecuteNonQuery(sqlU); } } }
public int DALInsertLongCodeRegistration(DataCollectionBLL obj) { using (SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"])) { try { string sql = "insert into [Come2myCityDB].[come2mycity].LongCodeRegistration(customer_name,address,mobileno,Sim_no,reg_date,IMEINO,customer_contact,no_usefor,send_data,Response_Msg,MissCallType,customer_contact1,customer_contact2,customer_contact3,customer_contact4)" + " values('" + obj.Customername + "','" + obj.Address + "','" + obj.Mobileno + "','" + obj.SIMno + "','" + obj.Regdate + "','" + obj.IMEIMO + "','" + obj.Customer_contact + "','" + obj.No_usefor + "','" + obj.Send_data + "','" + obj.ResponseMsg + "','" + obj.MissCallType1 + "','" + obj.Customer_contact1 + "','" + obj.Customer_contact2 + "','" + obj.Customer_contact3 + "','" + obj.Customer_contact4 + "')"; status = cc.ExecuteNonQuery(sql); } catch (SqlException ex) { throw ex; } finally { con.Close(); } } return(status); }
public int BLLInsertUserFriendRelative(CommonSqlQueryCode ur) { SqlConnection con1 = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]); int flag; try { string sql = " insert into FriendRelationMaster(UserId,FriendId,FriRelName,Relation,friendGroup,FriendPrefix,senderid,FR1,FR2," + "FR3,FR4,FR5,FR6,FR7,FR8,FR9,FR10,FR11,FR12,FR13,FR14,FR15,FR16,FR17,FR18," + " FR19,FR20,FR21,FR22,FR23,FR24,FR25,FR26,FR27,FR28,FR29,FR30) " + "values('" + ur.frnrelUserId + "','" + ur.frnrelFriendId + "',N'" + ur.usrFirstName + "" + ur.usrLastName + "',N'" + ur.frnrelRelation + "',N'" + ur.frnrelGroup + "','" + ur.FrnrelPrefix + "','" + ur.Senderid + "'," + "N'" + ur.FR1 + "',N'" + ur.FR2 + "',N'" + ur.FR3 + "',N'" + ur.FR4 + "',N'" + ur.FR5 + "',N'" + ur.FR6 + "',N'" + ur.FR7 + "',N'" + ur.FR8 + "'," + "N'" + ur.FR9 + "',N'" + ur.FR10 + "',N'" + ur.FR11 + "',N'" + ur.FR12 + "',N'" + ur.FR13 + "',N'" + ur.FR14 + "'," + "N'" + ur.FR15 + "',N'" + ur.FR16 + "',N'" + ur.FR17 + "',N'" + ur.FR18 + "',N'" + ur.FR19 + "',N'" + ur.FR20 + "',N'" + ur.FR21 + "'," + "N'" + ur.FR22 + "',N'" + ur.FR23 + "',N'" + ur.FR24 + "',N'" + ur.FR25 + "',N'" + ur.FR26 + "',N'" + ur.FR27 + "'," + "N'" + ur.FR28 + "',N'" + ur.FR29 + "',N'" + ur.FR30 + "')"; flag = ccr.ExecuteNonQuery(sql); if (flag == 1) { flag = 1; } else { flag = 0; } } catch (Exception ex) { throw ex; } finally { con1.Close(); } return(flag); }
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); }