private void AddSecurityAsDue() { try { DropDownList ddlPropertyName = (DropDownList)Master.FindControl("ddlProperty"); string PropertyName = ddlPropertyName.SelectedItem.Text; string PropertyVale = ddlPropertyName.SelectedValue; if (PropertyVale != "0") { string mobile = Session["s_MobileNo"].ToString(); DateTime DueMonth = System.DateTime.Now; string dueMonth = DueMonth.ToString("MMMM-yyyy"); string DuesType = "Security Deposit"; string DuesTypeValue = "3"; String sDate = txtDateOfJoining.Text; DateTime Duedate = System.DateTime.Now; DateTime DueDateNow = Convert.ToDateTime(txtDateOfJoining.Text); string Duesdate = DueDateNow.ToString("dd/MM/yyyy"); string Remark = "Security Deposit"; SendMsgToTenantsForSecurity(); SendMsgToPGManagerForSecurity(); uc.AddDues(mobile, PropertyName, PropertyVale, txtName.Text, txtName.ID, ddlRoomNo.SelectedItem.Text, txtMobileNo.Text, DuesType, DuesTypeValue, txtSecurityMoney.Text, Duesdate, dueMonth, Remark); string textmsg = " Dues Added Successfully"; ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpopsuccess('" + textmsg + "')</script>", false); } } catch (Exception Ex) { string errormsg = Ex.Message.ToString(); ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpoperror('" + errormsg + "')</script>", false); } }
private void addDueForRemainingDue(float remaingDue) { try { if (txtRecivedAmount.Text.Length > 0) { DropDownList ddlPropertyName = (DropDownList)Master.FindControl("ddlProperty"); string PropertyName = ddlPropertyName.SelectedItem.Text; string PropertyVale = ddlPropertyName.SelectedValue; if (PropertyVale != "0") { string t_Mobile = Session["d_t_Mobile"].ToString(); string mobile = Session["s_MobileNo"].ToString(); string RoomNo = Session["d_RoomNo"].ToString(); string DueType = Session["d_DuesTypeText"].ToString(); string DueValue = Session["d_DuesTypeValue"].ToString(); string PayeeName = Session["d_PayeeText"].ToString(); string PayeeVale = Session["d_PayeeValue"].ToString(); //DateTime TodayDate = System.DateTime.Now; //string DueDate = TodayDate.ToString("dd/MM/yyyy"); //string dueMonth = TodayDate.ToString("MMMM-yyyy"); string pendingDueDate = Session["d_DuesDate"].ToString(); string pendingDueMonth = Session["d_DuesMonth"].ToString(); string remaingpendingDue = remaingDue.ToString(); //Session["remaingpendingDue"] = remaingDue; uc.AddDues(mobile, PropertyName, PropertyVale, PayeeName, PayeeVale, RoomNo, t_Mobile, DueType, DueValue, remaingpendingDue, pendingDueDate, pendingDueMonth, txtRemark.Text); SendMsgToTenantsForDuePendingAmount(remaingDue); SendMsgToPGManagerForRemaingDue(remaingDue); string textmsg = " Dues pending '" + remaingpendingDue + "' Added Successfully"; ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpopsuccess('" + textmsg + "')</script>", false); } else { string errormsg = "Please enter recived amount"; ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpoperror('" + errormsg + "')</script>", false); } } } catch (Exception Ex) { string errormsg = Ex.Message.ToString(); ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpoperror('" + errormsg + "')</script>", false); } }
protected void btnDues_Click(object sender, EventArgs e) { try { if (ddlPayee.SelectedItem.Value != "0") { DropDownList ddlPropertyName = (DropDownList)Master.FindControl("ddlProperty"); string PropertyName = ddlPropertyName.SelectedItem.Text; string PropertyVale = ddlPropertyName.SelectedValue; if (PropertyVale != "0") { string t_Mobile = Session["t_MobileNo"].ToString(); string mobile = Session["s_MobileNo"].ToString(); txtRoomNoMobile.Text = Session["t_RoomNo"].ToString(); DateTime DueMonth = Convert.ToDateTime(txtDuesMonth.Text); string dueMonth = DueMonth.ToString("MMMM-yyyy"); uc.AddDues(mobile, PropertyName, PropertyVale, ddlPayee.SelectedItem.Text, ddlPayee.SelectedItem.Value, txtRoomNoMobile.Text, t_Mobile, ddlDuesType.SelectedItem.Text, ddlDuesType.SelectedItem.Value, txtDuesAmount.Text, txtDuesDate.Text, dueMonth, txtRemark.Text); SendMsgToTenantsForDue(); SendMsgToPGManager(); string textmsg = " Dues Added Successfully"; ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpopsuccess('" + textmsg + "')</script>", false); ddlPayee.SelectedIndex = 0; txtRoomNoMobile.Text = string.Empty; ddlDuesType.SelectedIndex = 0; txtDuesAmount.Text = string.Empty; txtDuesDate.Text = string.Empty; txtDuesMonth.Text = string.Empty; txtRemark.Text = string.Empty; btnDues.Visible = true; btnSaveChenges.Visible = false; } else { string errormsg = "Please Select property name"; ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpoperror('" + errormsg + "')</script>", false); } } } catch (Exception Ex) { string errormsg = Ex.Message.ToString(); ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpoperror('" + errormsg + "')</script>", false); } }