private void JournalForm_Load(object sender, EventArgs e) { string userName = (Form1)base.MdiParent.UserName; this.resetUI(userName); DailyJournalDataTable journal = this._journal.getJournal(); journal.AccountColumn.ColumnName = "رقم الحساب"; journal.codeColumn.ColumnName = "رقم القيد"; journal.CreditColumn.ColumnName = "دائن"; journal.DebitColumn.ColumnName = "مدين"; journal.Descrip_VCColumn.ColumnName = "الشرح"; journal.Date_DTColumn.ColumnName = "التاريخ"; this.dgvJournal.DataSource = journal; this.dgvJournal.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; this.dgvJournal.Columns["الشرح"].Width = 200; JournalForm._savedIndex = journal.Rows.Count - 1; base.WindowState = FormWindowState.Maximized; this.pnlMain.Enabled = false; AccountsBLL accountsBLL = new AccountsBLL(); COA_TDataTable allAccounts = accountsBLL.GetAllAccounts(); int[] array = allAccounts.Select <COA_TRow, int>(new Func <COA_TRow, int>((a) => a.GL_ID)).ToArray <int>(); AutoCompleteStringCollection autoCompleteStringCollections = new AutoCompleteStringCollection(); for (int i = 0; i < array.Count <int>(); i++) { autoCompleteStringCollections.Add(array[i].ToString()); } this.tbCode.AutoCompleteSource = AutoCompleteSource.CustomSource; this.tbCode.AutoCompleteMode = AutoCompleteMode.Suggest; this.tbCode.AutoCompleteCustomSource = autoCompleteStringCollections; }
protected void SubmitBtn_Click(object sender, EventArgs e) { string uname = (string)Session["Logged"]; string pass = (string)Session["lPwd"]; int aid = (int)Session["accId"]; AccountsBLL user = new AccountsBLL(); AccountsDAL a = user.retrieveUser(uname, pass); BuyerBLL buyer = new BuyerBLL(); BuyerDAL b = buyer.retrieveFinPlan(aid); string mainName = b.MainApplicantName; decimal mainSalary = b.MainApplicantSalary; string coName = b.CoApplicantName; decimal coSalary = b.CoApplicantSalary; decimal totSavings = b.totalSavings; decimal upfrontPayment = b.upfrontPaymentBudget; int loanServicePeriod = b.loanServicingPeriod; string useCpf = b.userCpfToService; decimal ab1 = decimal.Parse(theTotalSavings.Text); decimal ac1 = decimal.Parse(theUpfrontPaymentBudget.Text.Trim()); decimal asd = ab1 + ac1; decimal asdf = asd - (asd * 0.8m) + (asd * 0.0275m); Label1.Text = "Recommended Bufget: S$ " + asdf; }
public ActionResult AccountActivation(string id) { AccountsBLL ouser = new AccountsBLL(); ouser.AccountActivation(Global.Base64Decode(id)); return(View("response")); }
private void tbNote_KeyDown(object sender, KeyEventArgs e) { Keys keyCode = e.KeyCode; if ((keyCode == Keys.Return || keyCode != Keys.Right) && (string.IsNullOrEmpty(this.tbCode.Text) || !string.IsNullOrEmpty(this.tbAmount.Text)) && JournalForm.mode == Mode.New) { AccountsBLL accountsBLL = new AccountsBLL(); if (accountsBLL.isParent(Convert.ToInt32(this.tbCode.Text))) { MessageBox.Show("لا يمكنك اضافة حساب رئيسي"); this.tbCode.Focus(); } try { this._journal.addEntry(Convert.ToInt32(this.tbDocNumber.Text), Convert.ToInt32(this.tbCode.Text), Convert.ToDecimal(this.tbAmount.Text), this.tbNote.Text); this.dgvJournal.DataSource = this._journal.getJournal(); int num = Convert.ToInt32(this.tbAmount.Text) * -1.Text = num.ToString(); this.tbCode.Focus(); } catch (Exception exception) { MessageBox.Show(exception.Message); } } L_02a5: }
public AccountsForm() { this.components = null; base(); this.InitializeComponent(); this.accounts = new AccountsBLL(); }
// GET: Profile public ActionResult MyProfile() { AccountsBLL oAccBLL = new AccountsBLL(); var odetails = oAccBLL.GetUserProfile(Convert.ToString(Session["UserId"])); return(View(odetails)); }
protected void Page_Load(object sender, EventArgs e) { string username = (string)Session["Logged"]; string pass = (string)Session["lPwd"]; int aid = (int)Session["accId"]; AccountsBLL user = new AccountsBLL(); AccountsDAL p = user.retrieveUser(username, pass); string name = p.fullName; theName.Text = name; //Page lastPage = (Page)Context.Handler; //string asd = ((TextBox)lastPage.FindControl("loginTextbox")).Text; //SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MYDBConnection"].ConnectionString); //conn.Open(); //SqlDataAdapter sda = new SqlDataAdapter("SELECT * FROM Accounts WHERE userName ='******'", conn); //DataTable dt = new DataTable(); //sda.Fill(dt); //name = dt.Rows[0][3].ToString(); //theName.Text = name; }
public ActionResult LoginProcess(Admin_Login u) { try { AccountsBLL obj = new AccountsBLL(); U_USR_Lgn obj1 = new U_USR_Lgn(); obj1.Email_ID = u.EmailId; obj1.Pwd = u.Password; obj1.Created_by = u.UserName; U_ADMIN_lOGIN_Ref status = obj.LoginPro(obj1); if (status != null) { Session["AdminId"] = status.UserId; Session["AdminName"] = status.UserName; Session["AdminPic"] = status.ProfilePic; ModelState.Clear(); return(Content("Success", "text/html")); } else { return(Content("Invalid User", "text/html")); } } catch { return(Content("Invalid Password", "text/html")); } }
public ActionResult EditProfileDetails(MemberProfile obj, HttpPostedFileBase file) { AccountsBLL oAccBLL = new AccountsBLL(); string Images = ""; if (Request.Files.Count > 0) { int i = 0; foreach (string requestFile in Request.Files) { HttpPostedFileBase files = Request.Files[i]; if (files.ContentLength > 0) { string filestoragename = Guid.NewGuid().ToString() + file.FileName.Replace(" ", ""); string directory = Server.MapPath("~/Images/"); string path = Path.Combine(directory, filestoragename); files.SaveAs(path); Images = Images + "," + filestoragename; } i++; } } obj.EditProfile.Media_Id_Img = string.IsNullOrEmpty(Images.TrimStart(',', ' '))?string.Empty:"/Images/" + Images.TrimStart(',', ' '); obj.EditProfile.Usr_Id = Convert.ToString(Session["UserId"]); var status = oAccBLL.UpdateProfile(obj.EditProfile); return(RedirectToAction("MyProfile", "Profile")); }
public string ManualLogin(string EmailId, string Password) { try { U_USR_Lgn ologin = new U_USR_Lgn(); AccountsBLL oacc = new AccountsBLL(); Login odetail = oacc.Login(EmailId, Password); if (odetail != null) { if (!string.IsNullOrEmpty(odetail.Id) & !string.IsNullOrEmpty(odetail.First_Name)) { Session["UserId"] = odetail.Id; Session["UserName"] = odetail.First_Name; UpdateEventInvites(); return("1"); } return("0"); } else { return("0"); } } catch { return("0"); } }
public popupSearch() { this.components = null; base(); this.InitializeComponent(); this._accounts = new AccountsBLL(); }
public ActionResult Register(Registration obj) { try { AccountsBLL obll = new AccountsBLL(); string status = obll.Registration(obj); string message = string.Empty; if (!string.IsNullOrEmpty(status)) { if (status == "0") { message = "Registration failed,Please try again."; } else if (status == "2") { message = "Entered Email-Id is Already registered please try with new one. "; } else if (status != "") { Sendmail(status, obj.Email_Id); message = "Registration Successfull, Please verify your Email to Login"; } else { message = "Registration failed,Please try again."; } } ModelState.Clear(); return(Content(message, "text/html")); } catch { return(Content("Registration failed,Please try again.", "text/html")); } }
public ActionResult ChangePassword() { ProfileSecurity osec = new ProfileSecurity(); AccountsBLL oAccBLL = new AccountsBLL(); var odetails = oAccBLL.GetUserProfile(Convert.ToString(Session["UserId"])); osec.Profile_Pic = odetails.Media_Id_Img; return(View(osec)); }
protected void Page_Load(object sender, EventArgs e) { string uname = (string)Session["Logged"]; string pass = (string)Session["lPwd"]; int aid = (int)Session["accId"]; AccountsBLL user = new AccountsBLL(); AccountsDAL a = user.retrieveUser(uname, pass); string fullname = a.fullName; string mobile = a.mobile; string email = a.email; string address = a.address; BuyerBLL buyer = new BuyerBLL(); BuyerDAL b = buyer.retrieveFinPlan(aid); string mainName = b.MainApplicantName; decimal mainSalary = b.MainApplicantSalary; string coName = b.CoApplicantName; decimal coSalary = b.CoApplicantSalary; decimal totSavings = b.totalSavings; decimal upfrontPayment = b.upfrontPaymentBudget; int loanServicePeriod = b.loanServicingPeriod; string useCpf = b.userCpfToService; UserName.Text = fullname; Mobile.Text = mobile; Email.Text = email; Address.Text = address; theMainApplicantName.Text = mainName; theMainApplicantSalary.Text = mainSalary.ToString(); theCoApplicantName.Text = coName; theCoApplicantSalary.Text = coSalary.ToString(); theTotalSavings.Text = totSavings.ToString(); theUpfrontPaymentBudget.Text = upfrontPayment.ToString(); theLoanServicePeriod.Text = loanServicePeriod.ToString(); //Page lastPage = (Page)Context.Handler; //string asd = ((TextBox)lastPage.FindControl("loginTextbox")).Text; //SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MYDBConnection"].ConnectionString); //conn.Open(); //SqlDataAdapter sda = new SqlDataAdapter("SELECT * FROM Accounts WHERE userName ='******'", conn); //DataTable dt = new DataTable(); //sda.Fill(dt); //name1 = dt.Rows[0][3].ToString(); //theName.Text = name1; }
public ActionResult EditProfile() { AccountsBLL oAccBLL = new AccountsBLL(); MemberProfile oprofile = new MemberProfile(); var odetails = oAccBLL.GetUserProfile(Convert.ToString(Session["UserId"])); oprofile.EditProfile = odetails; oprofile.IsMarriedList = Global.getismarried(); oprofile.Gender = Global.getGender(); return(View(oprofile)); }
public WithdrawalForm() { this.components = null; base(); this.InitializeComponent(); this._accounts = new AccountsBLL(); this._cash = new CashBll(); this._voucher = new VoucherBll(); WithdrawalForm._mode = Mode.Null; WithdrawalForm._print = 0; this._directed = false; this._closed = false; }
public ActionResult Reset_Password(ProfileSecurity obj) { AccountsBLL oBLL = new AccountsBLL(); var status = oBLL.ResetPassword(obj.Usr_Id, obj.New_Password); if (status == "1") { return(Content("Password Changed Sucessfully", "text/html")); } else { return(Content("Please contact Admin", "text/html")); } }
public ActionResult Send_Pwd_rest_Link(Profile obj) { AccountsBLL oBLL = new AccountsBLL(); var status = oBLL.GetUserId(obj.Email_Id); if (!string.IsNullOrEmpty(status)) { Global o = new Global(); o.sendMail("", obj.Email_Id, "BAG Password Reset Link", "http://" + Global.MainLink + "/Account/ResetPassword?Id=" + status + ""); return(Content("Password Reset Link Sent To Your Main-Id", "text/html")); } else { return(Content("Please Contact Admin", "text/html")); } }
public ActionResult Change_Password(ProfileSecurity obj) { AccountsBLL oAccBll = new AccountsBLL(); obj.Usr_Id = Convert.ToString(Session["UserId"]); obj.Old_Password = string.IsNullOrEmpty(obj.Old_Password) ? string.Empty : obj.Old_Password; var status = oAccBll.ChangePassword(obj); if (status == "1") { return(Content("Password Changed Sucessfully", "text/html")); } else { return(Content("Please Enter Valid Password", "text/html")); } }
public async Task <IHttpActionResult> CreateUser(CreateUserDTO createUserModel) { AccountsBLL accounts = new AccountsBLL(Request); ResponseDTO <UserDTO> result = await accounts.CreateUser(createUserModel); if (result.RowAffected > 0) { string code = await accounts.GenerateCodeEmailConfirm(result.Data.Id); Uri linkConfirmEmail = new Uri(Url.Link("ConfirmEmailRoute", new { userId = result.Data.Id, code = code })); Uri locationHeader = new Uri(Url.Link("GetUserById", new { id = result.Data.Id })); accounts.sendEmailConfirm(result.Data.Id, linkConfirmEmail); return(Created(locationHeader, result)); } return(Content <ResponseBasic>(HttpStatusCode.BadRequest, result)); }
public popupAddForm() { this.components = null; base(); this.InitializeComponent(); this.accounts = new AccountsBLL(); CategoryDataTable categories = this.accounts.getCategories(); this.ddlCategory.DataSource = categories; this.ddlCategory.DisplayMember = "Category_Name"; this.ddlCategory.ValueMember = "Category_ID"; COA_TDataTable mainAccounts = this.accounts.GetMainAccounts(); this.ddlSub.DataSource = mainAccounts; this.ddlSub.DisplayMember = "GL_Name_VC"; this.ddlSub.ValueMember = "GL_ID"; int num = Convert.ToInt32(this.ddlCategory.SelectedValue); int nextCategoryCode = this.accounts.getNextCategoryCode(num).Text = nextCategoryCode.ToString(); }
//protected void SubmitRegistrationBtn_Click(object sender, EventArgs e) //{ // Random random = new Random(); // int generator = random.Next(10000, 99999); // SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MYDBConnection"].ConnectionString); // conn.Open(); // string sql = "INSERT INTO Accounts (AccountID, userName, password, fullName, mobile, email, address, accType) VALUES ('" + generator + "','" + userNameRegistration.Text + "','" + passwordRegistration.Text + "','" + inputFullName.Text + "','" + inputMobile.Text + "','" + inputEmail.Text + "','" + inputAddress.Text + "','" + accTypeRegistration.Text + "')"; // SqlCommand cmd = new SqlCommand(sql, conn); // string sql1 = "INSERT INTO BuyerFinPlan (AccountID, loanServicingPeriod, userCpfToService ) VALUES ('" + generator + "', 5, 'n')"; // SqlCommand cmd1 = new SqlCommand(sql1, conn); // cmd.ExecuteNonQuery(); // if (accTypeRegistration.Text == "Buyer") // { // cmd1.ExecuteNonQuery(); // } // ClientScript.RegisterStartupScript(Page.GetType(), "alert", "alert('User Registered');window.location='Login.aspx';", true); //} protected void SubmitRegistrationBtn_Click(object sender, EventArgs e) { if (userNameRegistration.Text.Length != 0 && passwordRegistration.Text.Length != 0) { Random random = new Random(); int accId = random.Next(10000, 99999); string uName = userNameRegistration.Text.Trim(); string pwd = passwordRegistration.Text.Trim(); string fullNm = inputFullName.Text.Trim(); string mobileNo = inputMobile.Text.Trim(); string emailAdd = inputEmail.Text.Trim(); string add = inputAddress.Text.Trim(); string accountType = accTypeRegistration.Text.Trim(); int loanServicePeriod = 5; string useCpf = "n"; AccountsBLL user = new AccountsBLL(); BuyerBLL buyer = new BuyerBLL(); if (user.createUser(accId, uName, pwd, fullNm, mobileNo, emailAdd, add, accountType) == true) { if (accountType == "Buyer") { buyer.createFinPlan(accId, loanServicePeriod, useCpf); ClientScript.RegisterStartupScript(Page.GetType(), "alert", "alert('User Registered');window.location='Login.aspx';", true); } else { ClientScript.RegisterStartupScript(Page.GetType(), "alert", "alert('User Registered');window.location='Login.aspx';", true); } } else { } } else { Response.Write("<script>alert('Please enter valid Username and Password')</script>"); } }
public ActionResult FacebookLogin(string code) { try { string data = FaceBookConnect.Fetch(code, "me"); FaceBookUser faceBookUser = new JavaScriptSerializer().Deserialize <FaceBookUser>(data); faceBookUser.PictureUrl = string.Format("https://graph.facebook.com/{0}/picture?type=large", faceBookUser.Id); SocialRegistration obj = new SocialRegistration(); obj.Id = faceBookUser.Id; obj.Email_Id = string.IsNullOrEmpty(faceBookUser.Email)? faceBookUser.Id + "@BAG.com": faceBookUser.Email; obj.First_Name = faceBookUser.Name; obj.Phone_No = string.Empty; obj.Profile_Pic = faceBookUser.PictureUrl; AccountsBLL obll = new AccountsBLL(); Login status = obll.Registration_ThirdParty(obj); if (status != null) { if (!string.IsNullOrEmpty(status.Id)) { Session["UserId"] = status.Id; Session["UserName"] = status.First_Name; UpdateEventInvites(); } return(RedirectToAction("Index", "Dashboard")); } else { return(RedirectToAction("Index", "Account")); } } catch { return(RedirectToAction("Index", "Home")); } }
public ActionResult GoogleLogin() { string googleplus_client_id = "936649599657-s9akus1uv18lo7b103ji7t3cu1ljlfjb.apps.googleusercontent.com"; string googleplus_client_sceret = "w5nmQnac-A2gBLR8dh2YWGqk"; string googleplus_redirect_url = "http://" + Global.MainLink + "/Account/GoogleLogin"; string Parameters; var url = Request.Url.Query; if (url != "") { string queryString = url.ToString(); char[] delimiterChars = { '=' }; string[] words = queryString.Split(delimiterChars); string code = words[1]; if (code != null) { //get the access token HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("https://accounts.google.com/o/oauth2/token"); webRequest.Method = "POST"; Parameters = "code=" + code + "&client_id=" + googleplus_client_id + "&client_secret=" + googleplus_client_sceret + "&redirect_uri=" + googleplus_redirect_url + "&grant_type=authorization_code"; byte[] byteArray = Encoding.UTF8.GetBytes(Parameters); webRequest.ContentType = "application/x-www-form-urlencoded"; webRequest.ContentLength = byteArray.Length; Stream postStream = webRequest.GetRequestStream(); // Add the post data to the web request postStream.Write(byteArray, 0, byteArray.Length); postStream.Close(); WebResponse response = webRequest.GetResponse(); postStream = response.GetResponseStream(); StreamReader reader = new StreamReader(postStream); string responseFromServer = reader.ReadToEnd(); GooglePlusAccessToken serStatus = JsonConvert.DeserializeObject <GooglePlusAccessToken>(responseFromServer); if (serStatus != null) { string accessToken = string.Empty; accessToken = serStatus.access_token; if (!string.IsNullOrEmpty(accessToken)) { string JSONDATA = ""; HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(@"https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=" + accessToken); httpWebRequest.Method = "GET"; httpWebRequest.ContentType = @"application/json; charset=utf-8"; var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse(); using (var streamReader = new StreamReader(httpResponse.GetResponseStream())) { JSONDATA = streamReader.ReadToEnd(); } var json_serializer = new JavaScriptSerializer(); GooglePlusLogin Profile = JsonConvert.DeserializeObject <GooglePlusLogin>(JSONDATA); SocialRegistration obj = new SocialRegistration(); obj.Id = Profile.id; obj.Email_Id = string.IsNullOrEmpty(Profile.email)?Profile.id + "@BAG.com": Profile.email; obj.First_Name = Profile.name; obj.Phone_No = string.Empty; obj.Profile_Pic = Profile.picture; AccountsBLL obll = new AccountsBLL(); Login status = obll.Registration_ThirdParty(obj); if (status != null) { if (!string.IsNullOrEmpty(status.Id)) { Session["UserId"] = status.Id; Session["UserName"] = status.First_Name; UpdateEventInvites(); return(RedirectToAction("Index", "Dashboard")); } } else { return(RedirectToAction("Index", "Account")); } } else { } } else { } } else { } } return(View("Index")); }
private void TransactionsReportFrom_Load(object sender, EventArgs e) { string str; ReportDocument reportDocument; ReportDataTable reportDataTable; ParameterValues parameterValue; ParameterDiscreteValue parameterDiscreteValue; ParameterValues parameterValue2; ParameterDiscreteValue parameterDiscreteValue2; ParameterValues parameterValue3; ParameterDiscreteValue parameterDiscreteValue3; ParameterValues parameterValue4; ParameterDiscreteValue parameterDiscreteValue4; ReportDocument reportDocument2; ParameterValues parameterValue5; ParameterDiscreteValue parameterDiscreteValue5; ParameterValues parameterValue6; ParameterDiscreteValue parameterDiscreteValue6; ReportDocument reportDocument3; ParameterValues parameterValue7; ParameterDiscreteValue parameterDiscreteValue7; ParameterValues parameterValue8; ParameterDiscreteValue parameterDiscreteValue8; ReportDocument reportDocument4; ParameterValues parameterValue9; ParameterDiscreteValue parameterDiscreteValue9; ParameterValues parameterValue10; ParameterDiscreteValue parameterDiscreteValue10; ReportDocument reportDocument5; AccountsViewDataTable accountsViewDataTable; ReportDocument reportDocument6; ReportDocument reportDocument7; ReportDocument reportDocument8; ParameterValues parameterValue11; ParameterDiscreteValue parameterDiscreteValue11; ParameterValues parameterValue12; ParameterDiscreteValue parameterDiscreteValue12; AccountsBLL accountsBLL = new AccountsBLL(); Cursor.Current = Cursors.WaitCursor; base.WindowState = FormWindowState.Maximized; switch (this.reportType) { case ReportType.TrialBalance: { this.set_Text("ميزان المراجعة"); reportDocument3 = new ReportDocument(); reportDocument3.Load(string.Concat(Path.GetDirectoryName(Application.ExecutablePath), "\\TrialBalanceCR.rpt")); reportDocument3.SetDataSource(this._reportBll.getTrialBalance(this.From, this.To)); parameterValue7 = new ParameterValues(); parameterDiscreteValue7 = new ParameterDiscreteValue(); parameterDiscreteValue7.set_Value(this.From); parameterValue7.Add(parameterDiscreteValue7); reportDocument3.DataDefinition.ParameterFields["from"].ApplyCurrentValues(parameterValue7); parameterValue8 = new ParameterValues(); parameterDiscreteValue8 = new ParameterDiscreteValue(); parameterDiscreteValue8.set_Value(this.To); parameterValue8.Add(parameterDiscreteValue8); reportDocument3.DataDefinition.ParameterFields["to"].ApplyCurrentValues(parameterValue8); this.crViewer.set_ReportSource(reportDocument3); } case ReportType.BalanceSheet: { this.set_Text("الميزانية العمومية"); reportDocument4 = new ReportDocument(); reportDocument4.Load(string.Concat(Path.GetDirectoryName(Application.ExecutablePath), "\\BalanceSheetCR.rpt")); reportDocument4.SetDataSource(this._reportBll.getBalanceSheet(this.From, this.To)); parameterValue9 = new ParameterValues(); parameterDiscreteValue9 = new ParameterDiscreteValue(); parameterDiscreteValue9.set_Value(this.From); parameterValue9.Add(parameterDiscreteValue9); reportDocument4.DataDefinition.ParameterFields["from"].ApplyCurrentValues(parameterValue9); parameterValue10 = new ParameterValues(); parameterDiscreteValue10 = new ParameterDiscreteValue(); parameterDiscreteValue10.set_Value(this.To); parameterValue10.Add(parameterDiscreteValue10); reportDocument4.DataDefinition.ParameterFields["to"].ApplyCurrentValues(parameterValue10); this.crViewer.set_ReportSource(reportDocument4); } case ReportType.Transactions: { this.set_Text("كشف حركة حساب"); str = accountsBLL.GetAccountByID(this.account)[0].GL_Name_VC; reportDocument = new ReportDocument(); reportDocument.Load(string.Concat(Path.GetDirectoryName(Application.ExecutablePath), "\\reportTest.rpt")); reportDataTable = this._reportBll.getByCodeDate(this.From, this.To, this.account); reportDocument.SetDataSource(reportDataTable); parameterValue = new ParameterValues(); parameterDiscreteValue = new ParameterDiscreteValue(); parameterDiscreteValue.set_Value(str); parameterValue.Add(parameterDiscreteValue); reportDocument.DataDefinition.ParameterFields["account"].ApplyCurrentValues(parameterValue); parameterValue2 = new ParameterValues(); parameterDiscreteValue2 = new ParameterDiscreteValue(); parameterDiscreteValue2.set_Value(this.From); parameterValue2.Add(parameterDiscreteValue2); reportDocument.DataDefinition.ParameterFields["dtFrom"].ApplyCurrentValues(parameterValue2); parameterValue3 = new ParameterValues(); parameterDiscreteValue3 = new ParameterDiscreteValue(); parameterDiscreteValue3.set_Value(this.To); parameterValue3.Add(parameterDiscreteValue3); reportDocument.DataDefinition.ParameterFields["dtTo"].ApplyCurrentValues(parameterValue3); parameterValue4 = new ParameterValues(); parameterDiscreteValue4 = new ParameterDiscreteValue(); parameterDiscreteValue4.set_Value(reportDataTable[reportDataTable.Count - 1].Balance); parameterValue4.Add(parameterDiscreteValue4); reportDocument.DataDefinition.ParameterFields["tBalance"].ApplyCurrentValues(parameterValue4); this.crViewer.set_ReportSource(reportDocument); } case ReportType.ProfitAndLoss: { this.set_Text("بيان الأرباح والخسائر"); reportDocument2 = new ReportDocument(); reportDocument2.Load(string.Concat(Path.GetDirectoryName(Application.ExecutablePath), "\\ProfitLossCR.rpt")); reportDocument2.SetDataSource(this._reportBll.getProfitAndLoss(this.From, this.To)); parameterValue5 = new ParameterValues(); parameterDiscreteValue5 = new ParameterDiscreteValue(); parameterDiscreteValue5.set_Value(this.From); parameterValue5.Add(parameterDiscreteValue5); reportDocument2.DataDefinition.ParameterFields["from"].ApplyCurrentValues(parameterValue5); parameterValue6 = new ParameterValues(); parameterDiscreteValue6 = new ParameterDiscreteValue(); parameterDiscreteValue6.set_Value(this.To); parameterValue6.Add(parameterDiscreteValue6); reportDocument2.DataDefinition.ParameterFields["to"].ApplyCurrentValues(parameterValue6); this.crViewer.set_ReportSource(reportDocument2); } case ReportType.Accounts: { this.set_Text("كشف أرصدة مجموعة حسابات"); reportDocument5 = new ReportDocument(); reportDocument5.Load(string.Concat(Path.GetDirectoryName(Application.ExecutablePath), "\\AccountsCR.rpt")); accountsViewDataTable = new AccountsBLL().GetAccountsView(); reportDocument5.SetDataSource(accountsViewDataTable); this.crViewer.set_ReportSource(reportDocument5); this.set_Text("الموظفون"); reportDocument6 = new ReportDocument(); reportDocument6.Load(string.Concat(Path.GetDirectoryName(Application.ExecutablePath), "\\EmployeeCR.rpt")); reportDocument6.SetDataSource(new EmployeeBll().getEmployee()); this.crViewer.set_ReportSource(reportDocument6); this.set_Text("الموردون"); reportDocument7 = new ReportDocument(); reportDocument7.Load(string.Concat(Path.GetDirectoryName(Application.ExecutablePath), "\\SupplierCR.rpt")); reportDocument7.SetDataSource(new SupplierBll().getSuppliers()); this.crViewer.set_ReportSource(reportDocument7); this.set_Text("مجمع الإهلاك"); reportDocument8 = new ReportDocument(); reportDocument8.Load(string.Concat(Path.GetDirectoryName(Application.ExecutablePath), "\\fixedCR.rpt")); reportDocument8.SetDataSource(this._reportBll.FixedAssetsReport(this.From, this.To)); parameterValue11 = new ParameterValues(); parameterDiscreteValue11 = new ParameterDiscreteValue(); parameterDiscreteValue11.set_Value(this.From); parameterValue11.Add(parameterDiscreteValue11); reportDocument8.DataDefinition.ParameterFields["from"].ApplyCurrentValues(parameterValue11); parameterValue12 = new ParameterValues(); parameterDiscreteValue12 = new ParameterDiscreteValue(); parameterDiscreteValue12.set_Value(this.To); parameterValue12.Add(parameterDiscreteValue12); reportDocument8.DataDefinition.ParameterFields["to"].ApplyCurrentValues(parameterValue12); this.crViewer.set_ReportSource(reportDocument8); goto; } case ReportType.None: { this.set_Cursor(Cursors.Default); return; } } }
protected void SignInBtn_Click(object sender, EventArgs e) { string username = loginTextbox.Text.Trim(); string password = passwordTextBox.Text.Trim(); AccountsBLL user = new AccountsBLL(); AccountsDAL p = user.retrieveUser(username, password); string accType = p.accType; int accId = p.AccountID; if (user.retrieveUserByLogin(username, password) == true) { Session["Logged"] = username; Session["lPwd"] = password; Session["accId"] = accId; if (accType.Equals("Buyer")) { Response.Redirect("index.aspx"); } else if (accType.Equals("Reseller")) { Response.Redirect("reseller.aspx"); } else if (accType.Equals("Banker")) { Response.Redirect("bankerIndex.aspx"); } } else { Response.Write("<script>alert('Please enter valid Username and Password')</script>"); } //SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MYDBConnection"].ConnectionString); //conn.Open(); //SqlDataAdapter sda = new SqlDataAdapter("SELECT * FROM Accounts WHERE userName ='******' AND password = '******'" , conn); //SqlDataAdapter sdaa = new SqlDataAdapter("SELECT * FROM Accounts WHERE accType ='Buyer'", conn); //DataTable dt = new System.Data.DataTable(); //sda.Fill(dt); //if(dt.Rows.Count == 1 ) //{ // utype = dt.Rows[0][7].ToString(); // if (utype == "Buyer") // { // Server.Transfer("index.aspx"); // } // else if (utype == "Reseller") // { // Server.Transfer("reseller.aspx"); // } // else if (utype == "Banker") // { // Server.Transfer("bankerIndex.aspx"); // } //} //else //{ // Response.Write("<script>alert('Please enter valid Username and Password')</script>"); //} //conn.Close(); }