public static DataTable GetFileList(string userid) { DataTable fileList = new DataTable(); using (SqlConnection connection = new SqlConnection()) { OpenConnection(connection); SqlCommand cmd = new SqlCommand(); cmd.Connection = connection; cmd.CommandTimeout = 0; ReturnVal oRtnValue = new ReturnVal(); string usertype = oRtnValue.ReturnValue("tblUserInfo", "userid", "'" + userid + "'", "usertype"); if (usertype == "Admin") { cmd.CommandText = "Select ID,FileName,Uploaded_Date,BranchName,Uploaded_By,UserType from dbo.View_Loan_info_For_admin"; } else { cmd.CommandText = "Select ID,FileName,Uploaded_Date,BranchName,Uploaded_By,UserType from dbo.View_Fileinfo_Details where HaveAccessUser='******'"; } cmd.CommandType = CommandType.Text; SqlDataAdapter adapter = new SqlDataAdapter(); adapter.SelectCommand = cmd; adapter.Fill(fileList); connection.Close(); } return(fileList); }
protected void btnNewLoan_Click(object sender, EventArgs e) { // entryType + (voucherDate.Day.ToString().Length == 1 ? "0" + voucherDate.Day.ToString() : voucherDate.Day.ToString()) + (voucherDate.Month.ToString().Length == 1 ? "0" + voucherDate.Month.ToString() : voucherDate.Month.ToString()) + DateTime.Now.Year.ToString().Substring(voucherDate.Year.ToString().Length - 2) + s; //string.Concat("NBL" + "'" + BrCode + "'" + "'" + drpLoanType.SelectedItem.Text + "'"); if (drpLoanType.SelectedItem.Text == "--Select--") { ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "MessageBox", "alert('Please Select Valid Loan Type')", true); Button1.Enabled = false; return; } else { ReturnVal oRtnValue = new ReturnVal(); string BrCode = oRtnValue.ReturnValue("View_BranchInfo", "userid", "'" + Session["userID"] + "'", "BranchCode"); string maxloanSL = oRtnValue.ReturnValue("LoanAplication", "brCode", "'" + BrCode + "'", "Count(*)+1"); txtAccount.Text = "NBL" + "" + BrCode + "" + "" + drpLoanType.SelectedItem.Text + "" + "" + (DateTime.Now.Day.ToString().Length == 1 ? "0" + DateTime.Now.Day.ToString() : DateTime.Now.Day.ToString()) + (DateTime.Now.Month.ToString().Length == 1 ? "0" + DateTime.Now.Month.ToString() : DateTime.Now.Month.ToString()) + DateTime.Now.Year.ToString().Substring(DateTime.Now.Year.ToString().Length - 2) + "" + "" + maxloanSL + ""; txtAccount.Enabled = false; drpLoanType.Enabled = false; btnSearch.Enabled = false; btnNewLoan.Enabled = false; Button1.Enabled = true; } //txtAccount.Text = "NBL" + "" + BrCode + "" + "" + drpLoanType.SelectedItem.Text + "" + "" + (DateTime.Now.Day.ToString().Length == 1 ? "0" + DateTime.Now.Day.ToString() : DateTime.Now.Day.ToString()) + (DateTime.Now.Month.ToString().Length == 1 ? "0" + DateTime.Now.Month.ToString() : DateTime.Now.Month.ToString()) + DateTime.Now.Year.ToString().Substring(DateTime.Now.Year.ToString().Length - 2) + "" + "" + maxloanSL + ""; }
public void LoadBranch(int a, string code) { DataSet ds = new DataSet(); SqlConnection conn = dbconnection.connection(); //string quiry = "select code from program where Code <>'" + code + "' order by code"; string quiry = "select BranchName,BrCode from BranchInfo where BrCode<200 order by BranchName"; ////string quiry = "select BranchName,BrCode from BranchInfo order by BranchName"; SqlDataAdapter dt = new SqlDataAdapter(quiry, conn); dt.Fill(ds); drpBranch.DataSource = ds; drpBranch.DataTextField = "BranchName"; drpBranch.DataValueField = "BrCode"; drpBranch.DataBind(); if (a == 1) { drpBranch.Items.Insert(0, "--ALL--"); if (Session["UserType"].ToString() != "Admin") { ReturnVal oRtnValue = new ReturnVal(); drpBranch.SelectedValue = oRtnValue.ReturnValue("View_BranchInfo", "userid", "'" + Session["userID"] + "'", "BranchCode"); } } }
public override bool Start(bool IsWorkingModel) { if (!IsOpen) { return(false); } var data_open = new byte[] { 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xF8 }; var data_add_tab = new byte[] { 0x02, 0x02, 0x07, 0x82, 0x30, 0x32, 0x31, 0x32, 0x40, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x03, 0x61 }; var data_close_sound = new byte[] { 0x02, 0x02, 0x07, 0x82, 0x30, 0x31, 0x34, 0x32, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x03, 0x49 }; var data_version = new byte[] { 0x02, 0x02, 0x06, 0x82, 0x30, 0x30, 0x30, 0x41, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x70 }; String ReturnVal; SendData(data_open, out ReturnVal, false); Thread.Sleep(200); SendData(data_add_tab, out ReturnVal, false); Thread.Sleep(200); SendData(data_close_sound, out ReturnVal, false); Thread.Sleep(200); SendData(data_version, out ReturnVal, true); Thread.Sleep(200); var result = ReturnVal.IndexOf("Decoder R2 V7.11") != -1; return(result); }
public void GridLoad() { string BrName; //string usertype; ReturnVal oRtnValue = new ReturnVal(); string usertype = oRtnValue.ReturnValue("tblUserInfo", "userid", "'" + Session["userID"] + "'", "usertype"); if (drpbranch.SelectedItem.Text == "--ALL--") { BrName = "%"; } else { BrName = drpbranch.SelectedItem.Text; } string LoanNature; if (DropLoanNature.SelectedItem.Text == "--ALL--") { LoanNature = "%"; } else { LoanNature = DropLoanNature.SelectedItem.Text; } SqlConnection conn = dbconnection.connection(); if (usertype == "Admin") { SqlCommand objcmd = new SqlCommand("select [AplicationNo],[CreateBy],[Designation],[UserType],[BranchName],[Create/LastModified] from View_LoanAolication where BranchName like '" + BrName + "' ORDER BY CONVERT(DATETIME, [Create/LastModified], 103) Desc ", conn); GridView1.DataSource = objcmd.ExecuteReader(); } else { SqlCommand objcmd = new SqlCommand("select [AplicationNo],[CreateBy],[Designation],[UserType],[BranchName],[Create/LastModified] from View_LoanAolicationAllUserWise where Athuntication_USERID= '" + Session["userID"] + "' and BranchName like '" + BrName + "' ORDER BY CONVERT(DATETIME, [Create/LastModified], 103) Desc ", conn); GridView1.DataSource = objcmd.ExecuteReader(); } GridView1.DataBind(); GridView1.EditIndex = -1; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LoadBranch(1, ""); if (Session["UserType"].ToString() != "Admin") { ReturnVal oRtnValue = new ReturnVal(); drpBranch.SelectedValue = oRtnValue.ReturnValue("View_BranchInfo", "userid", "'" + Session["userID"] + "'", "BranchCode"); drpBranch.Enabled = false; } } }
protected void btnSearch_Click(object sender, EventArgs e) { ReturnVal oRtnValue = new ReturnVal(); string Cont = oRtnValue.ReturnValue("LoanAplication", "AcountNo", "'" + txtAccount.Text + "'", "HTML"); //string original = Server.HtmlDecode(Cont); elm1.Value = Cont; //elm1.InnerHtml = Cont; //elm1.Value = original; lblDisplay.Text = elm1.Value; if (elm1.Value == "") { btnCommentSave.Enabled = false; elm1.Visible = false; } else { btnCommentSave.Enabled = true; elm1.Visible = true; //elm1.disabled = true; //elm1.disabled } //ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "MessageBox", "ChangeMode()", true); //elm1.EnableViewState = false; //elm1.EnableTheming = false; //Session["TempPage"] = Cont; //Server.Transfer("ShowTempPage.aspx"); //string url = "http://localhost/NBLCredit/tinymce/jscripts/tiny_mce/plugins/preview/preview.html"; //string s = "window.open('" + url + "', 'popup_window', 'width=300,height=100,left=100,top=100,resizable=yes');"; //ClientScript.RegisterStartupScript(this.GetType(), "script", s, true); Session["Aplication"] = null; }
/// The function performing planning using Forward Search and the specified \a method public bool forwardSearch(iThinkState InitialState, iThinkState GoalState, iThinkActionManager ActionManager) { iThinkPlan ReturnVal; _OpenStates.Clear(); _VisitedStates.Clear(); iThinkPlan step = new iThinkPlan(InitialState); _OpenStates.Add(step); _VisitedStates.Add(step.getState()); ReturnVal = SearchMethod(GoalState, ActionManager, _OpenStates, _VisitedStates); if (ReturnVal == null) { return(false); } else if (ReturnVal.hasPlan()) { return(true); } return(false); }
public bool forwardSearchBounded(iThinkState InitialState, iThinkState GoalState, iThinkActionManager ActionManager, double timelimit, int retries = 3) { iThinkPlan ReturnVal; _OpenStates.Clear(); _VisitedStates.Clear(); iThinkPlan step = new iThinkPlan(InitialState); _OpenStates.Add(step); _VisitedStates.Add(step.getState()); ReturnVal = SearchMethodBounded(GoalState, ActionManager, _OpenStates, _VisitedStates, timelimit); if (ReturnVal == null) { return(false); } else if (compareStates(ReturnVal.getState(), GoalState)) { return(true); } return(false); }
protected void btnSearch_Click(object sender, EventArgs e) { string Cont = null; ReturnVal oRtnValue = new ReturnVal(); if (Session["Aplication"] != null) { Cont = oRtnValue.ReturnValue("LoanAplicationHistory", "SL", "'" + Session["Aplication"] + "'", "HTML"); elm1.Value = Cont; if (Cont != "") { txtAccount.Enabled = false; drpLoanType.Enabled = false; btnSearch.Enabled = false; btnNewLoan.Enabled = false; Button1.Enabled = true; } else { Button1.Enabled = false; } } else { string userid = oRtnValue.ReturnValue("LoanAplication", "AcountNo", "'" + txtAccount.Text + "'", "userID"); if (Session["userID"].ToString().ToUpper() == userid.ToUpper()) { Cont = oRtnValue.ReturnValue("LoanAplication", "AcountNo", "'" + txtAccount.Text + "'", "HTML"); elm1.Value = Cont; if (Cont != "") { txtAccount.Enabled = false; drpLoanType.Enabled = false; btnSearch.Enabled = false; btnNewLoan.Enabled = false; Button1.Enabled = true; } else { Button1.Enabled = false; } } else { ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "MessageBox", "alert('Only initiator are eligible to change the proposal')", true); Button1.Enabled = false; } } //elm1.Value = Cont; //if (Cont != "") //{ // txtAccount.Enabled = false; // drpLoanType.Enabled = false; // btnSearch.Enabled = false; // btnNewLoan.Enabled = false; // Button1.Enabled = true; //} //else //{ // Button1.Enabled = false; //} }
protected void btnSearch_Click(object sender, EventArgs e) { ReturnVal oRtnValue = new ReturnVal(); //string BrCode = oRtnValue.ReturnValue("View_BranchInfo", "userid", "'" + Session["userID"] + "'", "BranchCode"); if (oRtnValue.ReturnValue("LoanAplicationFinancial", "AcountNo", "'" + txtAplication.Text + "' and sub_Sl ='" + txtPlSL.Text + "'", "AcountNo") != "") { ConnectionDatabase oConnectionDatabase = new ConnectionDatabase(); SqlConnection con; SqlCommand cmd; string condition = "Where AcountNo='" + txtAplication.Text + "' and sub_Sl ='" + txtPlSL.Text + "'"; con = oConnectionDatabase.DatabaseConnection(); cmd = new SqlCommand("SELECT * from LoanAplicationFinancial " + condition, con); cmd.CommandType = CommandType.Text; SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); try { da.Fill(dt); } catch { } con.Close(); DrpType.Text = dt.Rows[0]["Type"].ToString(); DropNature.Text = dt.Rows[0]["Nature"].ToString(); txtExistingLimmit.Text = dt.Rows[0]["ExistingLimitAmount"].ToString(); txtProposedLimit.Text = dt.Rows[0]["ProposedLimit"].ToString(); txtRevisedLimit.Text = dt.Rows[0]["RevisedLimit"].ToString(); txtOutStanding.Text = dt.Rows[0]["Outstanding"].ToString(); txtOverDeu.Text = dt.Rows[0]["OverDue"].ToString(); txtEOL.Text = dt.Rows[0]["EOL"].ToString(); txtExistingSanction.Text = dt.Rows[0]["ExistingSanction"].ToString(); txtSanctionAmount.Text = dt.Rows[0]["ProposedSanction"].ToString(); txtRevisedSanction.Text = dt.Rows[0]["RevisedSanction"].ToString(); txtexixtingTenor.Text = dt.Rows[0]["ExistingTenor"].ToString(); txtProposedTenor.Text = dt.Rows[0]["ProposedTenor"].ToString(); txtTenorRevised.Text = dt.Rows[0]["RevisedTenor"].ToString(); txtExixtingInstallmentAmount.Text = dt.Rows[0]["ExistingInstallmentAmount"].ToString(); txtProposedInstallment.Text = dt.Rows[0]["ProposedInstallmentAmount"].ToString(); txtRevisedInstallment.Text = dt.Rows[0]["RevisedInstallmentAmount"].ToString(); txtExistingLCComission.Text = dt.Rows[0]["ExistingLC_Comission"].ToString(); txtProposedLCComission.Text = dt.Rows[0]["ProposedLC_Comission"].ToString(); txtRevisedLCComission.Text = dt.Rows[0]["RevisedLC_Comission"].ToString(); txtExistingAcceptedComission.Text = dt.Rows[0]["ExistingAcceptedComision"].ToString(); txtAcceptedCommisionProposed.Text = dt.Rows[0]["proposedAcceptedComision"].ToString(); txtAcceptedComissionRevised.Text = dt.Rows[0]["RevisedAcceptedComision"].ToString(); if (!string.IsNullOrEmpty(dt.Rows[0]["SanctionDate"].ToString())) { txtSanctionDate.Text = DateTime.Parse(dt.Rows[0]["SanctionDate"].ToString()).ToString("dd/MM/yyyy"); } if (!string.IsNullOrEmpty(dt.Rows[0]["ProposedDate"].ToString())) { txtProposedDate.Text = DateTime.Parse(dt.Rows[0]["SanctionDate"].ToString()).ToString("dd/MM/yyyy"); } txtExistingInterestRate.Text = dt.Rows[0]["ExistingInttRate"].ToString(); txtProposedInttRate.Text = dt.Rows[0]["ProposedInttRate"].ToString(); txtRevisedInttRate.Text = dt.Rows[0]["RevisedInttRate"].ToString(); txtExistingGracePriod.Text = dt.Rows[0]["ExixtingGrascePriod"].ToString(); txtProposedGracePreiod.Text = dt.Rows[0]["ProposedGrascePriod"].ToString(); txtRevisedGracePreiod.Text = dt.Rows[0]["RevisedGrascePriod"].ToString(); DropStatus.Text = dt.Rows[0]["Status"].ToString(); txtMargin.Text = dt.Rows[0]["Margin"].ToString(); if (!string.IsNullOrEmpty(dt.Rows[0]["ValidityDate"].ToString())) { txtvalidityDate.Text = DateTime.Parse(dt.Rows[0]["ValidityDate"].ToString()).ToString("dd/MM/yyyy"); } if (!string.IsNullOrEmpty(dt.Rows[0]["GroupSL"].ToString())) { YrChkBox.Checked = true; Group.Visible = true; SubGroup.Visible = true; drpGroup.SelectedValue = dt.Rows[0]["GroupSL"].ToString(); LoadSubGroup(1, drpGroup.SelectedValue); if (!string.IsNullOrEmpty(dt.Rows[0]["SubGroupSL"].ToString())) { DropSubGroup.SelectedValue = dt.Rows[0]["SubGroupSL"].ToString(); //ReturnVal oRtnValue1 = new ReturnVal(); //DropSubGroup.Text = oRtnValue.ReturnValue("SubGroupInfo", "SubgroupSL", "'" + dt.Rows[0]["SubGroupSL"].ToString() + "'", "SubGroupName"); } } else { YrChkBox.Checked = false; Group.Visible = false; SubGroup.Visible = false; } } else { //txtPlSL.Text = ""; DrpType.Text = ""; DropNature.Text = ""; txtExistingLimmit.Text = ""; txtProposedLimit.Text = ""; txtRevisedLimit.Text = ""; txtTenorRevised.Text = ""; txtOutStanding.Text = ""; txtOverDeu.Text = ""; txtEOL.Text = ""; txtExistingSanction.Text = ""; txtSanctionAmount.Text = ""; txtRevisedSanction.Text = ""; txtexixtingTenor.Text = ""; txtProposedTenor.Text = ""; txtTenorRevised.Text = ""; txtExixtingInstallmentAmount.Text = ""; txtProposedInstallment.Text = ""; txtRevisedInstallment.Text = ""; txtExistingLCComission.Text = ""; txtProposedLCComission.Text = ""; txtRevisedLCComission.Text = ""; txtExistingAcceptedComission.Text = ""; txtAcceptedCommisionProposed.Text = ""; txtAcceptedComissionRevised.Text = ""; txtSanctionDate.Text = ""; txtProposedDate.Text = ""; txtExistingInterestRate.Text = ""; txtProposedInttRate.Text = ""; txtRevisedInttRate.Text = ""; txtExistingGracePriod.Text = ""; txtProposedGracePreiod.Text = ""; txtRevisedGracePreiod.Text = ""; DropStatus.Text = ""; txtMargin.Text = ""; txtvalidityDate.Text = ""; } }
protected void btnSave_Click(object sender, EventArgs e) { ReturnVal oRtnValue = new ReturnVal(); int i = 0; if ((oRtnValue.ReturnValue("LoanAplication", "AcountNo", "'" + txtAplication.Text + "'", "AcountNo") == "") || (txtAplication.Text == "")) { ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "MessageBox", "alert('Please provide valid Loan Application NO.')", true); //txtAplication.ForeColor= return; } //ReturnVal oRtnValue = new ReturnVal(); //string BrCode = oRtnValue.ReturnValue("View_BranchInfo", "userid", "'" + Session["userID"] + "'", "BranchCode"); string oldAccount = oRtnValue.ReturnValue("LoanAplication", "AcountNo", "'" + txtAplication.Text + "'", "AcountNo"); SqlConnection conn = dbconnection.connection(); using (SqlCommand cmd = new SqlCommand("SP_LoanAplicationFinancial", conn)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@AcountNo", txtAplication.Text); if (!string.IsNullOrEmpty(txtPlSL.Text)) { cmd.Parameters.Add("@sub_Sl", SqlDbType.Int).Value = txtPlSL.Text; } else { cmd.Parameters.Add("@sub_Sl", SqlDbType.Int).Value = null; } cmd.Parameters.AddWithValue("@Type", DrpType.Text); cmd.Parameters.AddWithValue("@Nature", DropNature.Text); if (drpGroup.SelectedValue != "--Select--" && drpGroup.SelectedValue != "9999") { cmd.Parameters.Add("@GroupSL", SqlDbType.Int).Value = drpGroup.SelectedValue; } else { cmd.Parameters.Add("@GroupSL", SqlDbType.Int).Value = null; } if (DropSubGroup.SelectedValue != "--Select--" && DropSubGroup.SelectedValue != "9999" && DropSubGroup.SelectedValue != "") { cmd.Parameters.Add("@SubGroupSL", SqlDbType.Int).Value = DropSubGroup.SelectedValue; } else { cmd.Parameters.Add("@SubGroupSL", SqlDbType.Int).Value = null; } if (!string.IsNullOrEmpty(txtExistingLimmit.Text)) { cmd.Parameters.Add("@ExistingLimitAmount", SqlDbType.Decimal).Value = txtExistingLimmit.Text; } else { cmd.Parameters.Add("@ExistingLimitAmount", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtProposedLimit.Text)) { cmd.Parameters.Add("@ProposedLimit", SqlDbType.Decimal).Value = txtProposedLimit.Text; } else { cmd.Parameters.Add("@ProposedLimit", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtRevisedLimit.Text)) { cmd.Parameters.Add("@RevisedLimit", SqlDbType.Decimal).Value = txtRevisedLimit.Text; } else { cmd.Parameters.Add("@RevisedLimit", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtOutStanding.Text)) { cmd.Parameters.Add("@Outstanding", SqlDbType.Decimal).Value = txtOutStanding.Text; } else { cmd.Parameters.Add("@Outstanding", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtOverDeu.Text)) { cmd.Parameters.Add("@OverDue", SqlDbType.Decimal).Value = txtOverDeu.Text; } else { cmd.Parameters.Add("@OverDue", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtEOL.Text)) { cmd.Parameters.Add("@EOL", SqlDbType.Decimal).Value = txtEOL.Text; } else { cmd.Parameters.Add("@EOL", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtExistingSanction.Text)) { cmd.Parameters.Add("@ExistingSanction", SqlDbType.Decimal).Value = txtExistingSanction.Text; } else { cmd.Parameters.Add("@ExistingSanction", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtSanctionAmount.Text)) { cmd.Parameters.Add("@ProposedSanction", SqlDbType.Decimal).Value = txtSanctionAmount.Text; } else { cmd.Parameters.Add("@ProposedSanction", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtRevisedSanction.Text)) { cmd.Parameters.Add("@RevisedSanction", SqlDbType.Decimal).Value = txtRevisedSanction.Text; } else { cmd.Parameters.Add("@RevisedSanction", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtexixtingTenor.Text)) { cmd.Parameters.Add("@ExistingTenor", SqlDbType.Decimal).Value = txtexixtingTenor.Text; } else { cmd.Parameters.Add("@ExistingTenor", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtProposedTenor.Text)) { cmd.Parameters.Add("@ProposedTenor", SqlDbType.Decimal).Value = txtProposedTenor.Text; } else { cmd.Parameters.Add("@ProposedTenor", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtTenorRevised.Text)) { cmd.Parameters.Add("@RevisedTenor", SqlDbType.Decimal).Value = txtTenorRevised.Text; } else { cmd.Parameters.Add("@RevisedTenor", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtExixtingInstallmentAmount.Text)) { cmd.Parameters.Add("@ExistingInstallmentAmount", SqlDbType.Decimal).Value = txtExixtingInstallmentAmount.Text; } else { cmd.Parameters.Add("@ExistingInstallmentAmount", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtProposedInstallment.Text)) { cmd.Parameters.Add("@ProposedInstallmentAmount", SqlDbType.Decimal).Value = txtProposedInstallment.Text; } else { cmd.Parameters.Add("@ProposedInstallmentAmount", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtRevisedInstallment.Text)) { cmd.Parameters.Add("@RevisedInstallmentAmount", SqlDbType.Decimal).Value = txtRevisedInstallment.Text; } else { cmd.Parameters.Add("@RevisedInstallmentAmount", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtExistingLCComission.Text)) { cmd.Parameters.Add("@ExistingLC_Comission", SqlDbType.Decimal).Value = txtExistingLCComission.Text; } else { cmd.Parameters.Add("@ExistingLC_Comission", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtProposedLCComission.Text)) { cmd.Parameters.Add("@ProposedLC_Comission", SqlDbType.Decimal).Value = txtProposedLCComission.Text; } else { cmd.Parameters.Add("@ProposedLC_Comission", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtRevisedLCComission.Text)) { cmd.Parameters.Add("@RevisedLC_Comission", SqlDbType.Decimal).Value = txtRevisedLCComission.Text; } else { cmd.Parameters.Add("@RevisedLC_Comission", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtExistingAcceptedComission.Text)) { cmd.Parameters.Add("@ExistingAcceptedComision", SqlDbType.Decimal).Value = txtExistingAcceptedComission.Text; } else { cmd.Parameters.Add("@ExistingAcceptedComision", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtAcceptedCommisionProposed.Text)) { cmd.Parameters.Add("@proposedAcceptedComision", SqlDbType.Decimal).Value = txtAcceptedCommisionProposed.Text; } else { cmd.Parameters.Add("@proposedAcceptedComision", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtAcceptedComissionRevised.Text)) { cmd.Parameters.Add("@RevisedAcceptedComision", SqlDbType.Decimal).Value = txtAcceptedComissionRevised.Text; } else { cmd.Parameters.Add("@RevisedAcceptedComision", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtProposedDate.Text)) { //cmd.Parameters.Add("@@SanctionDate", SqlDbType.Decimal).Value = txtAcceptedComission2.Text; //cmd.Parameters.AddWithValue("@SanctionDate", DateTime.Now.ToString("MM/dd/yyyy")); //cmd.Parameters.AddWithValue("@ProposedDate", DateTime.Parse(txtProposedDate.Text).ToString("dd/MM/yyyy")); //string s = (DateTime.ParseExact(txtProposedDate.Text.Trim(), "dd/MM/yyyy", new CultureInfo("fr-FR", true))).ToString("MM/dd/yyyy"); cmd.Parameters.AddWithValue("@ProposedDate", (DateTime.ParseExact(txtProposedDate.Text.Trim(), "dd/MM/yyyy", new CultureInfo("fr-FR", true))).ToString("MM/dd/yyyy")); //(DateTime.ParseExact(txtBoxLCA_DATE.Text.Trim(), "dd-MM-yyyy", new CultureInfo("fr-FR", true))).ToString("MM/dd/yyyy") } else { //cmd.Parameters.Add("@AcceptedComision2", SqlDbType.Decimal).Value = SqlDecimal.Null; //cmd.Parameters.AddWithValue("@SanctionDate", DateTime.Now.ToString("MM/dd/yyyy")); cmd.Parameters.Add("@ProposedDate", SqlDbType.Date).Value = SqlDateTime.Null; } if (!string.IsNullOrEmpty(txtSanctionDate.Text)) { //cmd.Parameters.Add("@@SanctionDate", SqlDbType.Decimal).Value = txtAcceptedComission2.Text; //cmd.Parameters.AddWithValue("@SanctionDate", DateTime.Now.ToString("MM/dd/yyyy")); //cmd.Parameters.AddWithValue("@SanctionDate", DateTime.Parse(txtSanctionDate.Text).ToString("dd/MM/yyyy")); cmd.Parameters.AddWithValue("@SanctionDate", (DateTime.ParseExact(txtProposedDate.Text.Trim(), "dd/MM/yyyy", new CultureInfo("fr-FR", true))).ToString("MM/dd/yyyy")); } else { //cmd.Parameters.Add("@AcceptedComision2", SqlDbType.Decimal).Value = SqlDecimal.Null; //cmd.Parameters.AddWithValue("@SanctionDate", DateTime.Now.ToString("MM/dd/yyyy")); cmd.Parameters.Add("@SanctionDate", SqlDbType.Date).Value = SqlDateTime.Null; } if (!string.IsNullOrEmpty(txtExistingInterestRate.Text)) { cmd.Parameters.Add("@ExistingInttRate", SqlDbType.Decimal).Value = txtExistingInterestRate.Text; } else { cmd.Parameters.Add("@ExistingInttRate", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtProposedInttRate.Text)) { cmd.Parameters.Add("@ProposedInttRate", SqlDbType.Decimal).Value = txtProposedInttRate.Text; } else { cmd.Parameters.Add("@ProposedInttRate", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtRevisedInttRate.Text)) { cmd.Parameters.Add("@RevisedInttRate", SqlDbType.Decimal).Value = txtRevisedInttRate.Text; } else { cmd.Parameters.Add("@RevisedInttRate", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtExistingGracePriod.Text)) { cmd.Parameters.Add("@ExixtingGrascePriod", SqlDbType.Decimal).Value = txtExistingGracePriod.Text; } else { cmd.Parameters.Add("@ExixtingGrascePriod", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtProposedGracePreiod.Text)) { cmd.Parameters.Add("@ProposedGrascePriod", SqlDbType.Decimal).Value = txtProposedGracePreiod.Text; } else { cmd.Parameters.Add("@ProposedGrascePriod", SqlDbType.Decimal).Value = SqlDecimal.Null; } if (!string.IsNullOrEmpty(txtRevisedGracePreiod.Text)) { cmd.Parameters.Add("@RevisedGrascePriod", SqlDbType.Decimal).Value = txtRevisedGracePreiod.Text; } else { cmd.Parameters.Add("@RevisedGrascePriod", SqlDbType.Decimal).Value = SqlDecimal.Null; } cmd.Parameters.AddWithValue("@Margin", txtMargin.Text); cmd.Parameters.AddWithValue("@Status", DropStatus.Text); cmd.Parameters.AddWithValue("@userid", Session["userID"]); cmd.Parameters.AddWithValue("@Cdate", DateTime.Now.ToString("yyyy-MM-dd")); if (!string.IsNullOrEmpty(txtSanctionDate.Text)) { cmd.Parameters.AddWithValue("@ValidityDate", (DateTime.ParseExact(txtvalidityDate.Text.Trim(), "dd/MM/yyyy", new CultureInfo("fr-FR", true))).ToString("MM/dd/yyyy")); } else { cmd.Parameters.Add("@ValidityDate", SqlDbType.Date).Value = SqlDateTime.Null; } //////////// //cmd.ExecuteNonQuery(); try { //cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); i = 1; } catch { } conn.Close(); if (i == 1) { if (oldAccount == "") { ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "MessageBox", "alert('Data Saved successfully, Receive document for final the submission')", true); } else { ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "MessageBox", "alert('Data updated Successfully')", true); //txtAccount.Enabled = true; //txtAccount.Text = ""; //drpLoanType.Enabled = true; //btnSearch.Enabled = true; //btnNewLoan.Enabled = true; //Button1.Enabled = true; //elm1.Value = ""; //Button1.Enabled = false; } } else { ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "MessageBox", "alert('Data Can not Save')", true); //Button1.Enabled = true; } } }
public void Button1_Click(object sender, EventArgs e) { int i = 0; string key = txtAccount.Text; string content = elm1.Value; ////string content = Server.HtmlEncode(elm1.Value); float DTarget = 0; float DAchievement = 0; float ATarget = 0; float AAchievement = 0; float clasification = 0; if (txtDepositTarget.Text != "") { DTarget = (float)Convert.ToDouble(txtDepositTarget.Text); } if (txtDepositAchievemen.Text != "") { DAchievement = (float)Convert.ToDouble(txtDepositAchievemen.Text); } if (txtAdvanchTarget.Text != "") { ATarget = (float)Convert.ToDouble(txtAdvanchTarget.Text); } if (txtAdvanchAchievemen.Text != "") { AAchievement = (float)Convert.ToDouble(txtAdvanchAchievemen.Text); } if (txtClasification.Text != "") { clasification = (float)Convert.ToDouble(txtClasification.Text); } if (content == "") { ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "MessageBox", "alert('Please Create or Upload Loan Application')", true); Button1.Enabled = true; return; } ReturnVal oRtnValue = new ReturnVal(); string BrCode = oRtnValue.ReturnValue("View_BranchInfo", "userid", "'" + Session["userID"] + "'", "BranchCode"); string oldAccount = oRtnValue.ReturnValue("LoanAplication", "AcountNo", "'" + txtAccount.Text + "'", "AcountNo"); SqlConnection conn = dbconnection.connection(); using (SqlCommand cmd = new SqlCommand("SPInsertGLPLBalance", conn)) { cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "LoanContent"; cmd.Parameters.AddWithValue("@AcountNo", key); cmd.Parameters.AddWithValue("@HTML", content); cmd.Parameters.AddWithValue("@userid", Session["userID"]); cmd.Parameters.AddWithValue("@BrCode", BrCode); cmd.Parameters.AddWithValue("@creation", DateTime.Now); //cmd.Parameters.AddWithValue("@creation", DateTime.Now.ToString("MM/dd/yyyy HH:MM")); cmd.Parameters.AddWithValue("@DTarget", DTarget); cmd.Parameters.AddWithValue("@DAchievement", DAchievement); cmd.Parameters.AddWithValue("@ATarget", ATarget); cmd.Parameters.AddWithValue("@AAchievement", AAchievement); cmd.Parameters.AddWithValue("@ADRTarget", txtADRTarget.Text); cmd.Parameters.AddWithValue("@ADRAchievement", txtADRAchievemen.Text); cmd.Parameters.AddWithValue("@LoanSubject", txtSubject.Text); cmd.Parameters.AddWithValue("@Clasification", clasification); cmd.Parameters.AddWithValue("@CustomerName", txtCustomerName.Text); if (!string.IsNullOrEmpty(AsOnDate.Text)) { //cmd.Parameters.AddWithValue("@AsonDate", DateTime.Parse(AsOnDate.Text).ToString("MM/dd/yyyy")); cmd.Parameters.AddWithValue("@AsonDate", (DateTime.ParseExact(AsOnDate.Text.Trim(), "dd/MM/yyyy", new CultureInfo("fr-FR", true))).ToString("MM/dd/yyyy")); } else { cmd.Parameters.Add("@AsonDate", SqlDbType.Date).Value = SqlDecimal.Null; } //cmd.ExecuteNonQuery(); try { //cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); i = 1; } catch { } conn.Close(); if (i == 1) { if (oldAccount == "") { ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "MessageBox", "alert('Application Saved successfully, Receive document for final the submission')", true); Session["Aplicationid"] = txtAccount.Text; txtAccount.Enabled = true; txtAccount.Text = ""; drpLoanType.Enabled = true; btnSearch.Enabled = true; btnNewLoan.Enabled = true; Button1.Enabled = true; elm1.Value = ""; Button1.Enabled = false; //Server.Transfer("LoanDocumentChecklist.aspx"); Response.Redirect("LoanDocumentChecklist.aspx"); } else { ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "MessageBox", "alert('Aplication updated Successfully')", true); txtAccount.Enabled = true; txtAccount.Text = ""; drpLoanType.Enabled = true; btnSearch.Enabled = true; btnNewLoan.Enabled = true; Button1.Enabled = true; elm1.Value = ""; Button1.Enabled = false; } } else { ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "MessageBox", "alert('Data Can not Save')", true); Button1.Enabled = true; } } }
public void GridLoad() { ReturnVal oRtnValue = new ReturnVal(); string usertype = oRtnValue.ReturnValue("tblUserInfo", "userid", "'" + Session["userID"] + "'", "usertype"); string BrName; if (drpbranch.SelectedItem.Text == "--ALL--") { BrName = "%"; } else { BrName = drpbranch.SelectedItem.Text; } string status; if (Rstaus.SelectedItem.Text == "--ALL--") { status = "%"; } else { status = Rstaus.SelectedItem.Text; } SqlConnection conn = dbconnection.connection(); if (usertype == "Admin") { if ((txtAccount.Text == "--ALL--") || (txtAccount.Text == "")) { SqlCommand objcmd = new SqlCommand("select [AcountNo],[Status],[Comments],[EmployeeName] ,[UserType] ,[Designation],[BranchName],[Date] from View_LoanAplicationComments where BranchName like '" + BrName + "' and Status like '" + status + "' ORDER BY CONVERT(DATETIME, [Date], 103) Desc ", conn); GridView1.DataSource = objcmd.ExecuteReader(); } else { SqlCommand objcmd = new SqlCommand("select [AcountNo],[Status],[Comments],[EmployeeName] ,[UserType] ,[Designation],[BranchName],[Date] from View_LoanAplicationComments where AcountNo = '" + txtAccount.Text + "' ORDER BY CONVERT(DATETIME, [Date], 103) Desc ", conn); GridView1.DataSource = objcmd.ExecuteReader(); } } else { if ((txtAccount.Text == "--ALL--") || (txtAccount.Text == "")) { SqlCommand objcmd = new SqlCommand("select [AcountNo],[Status],[Comments],[EmployeeName] ,[UserType] ,[Designation],[BranchName],[Date] from View_LoanAplicationCommentsAll where Autherised_UserID= '" + Session["userID"] + "' and BranchName like '" + BrName + "' and Status like '" + status + "' ORDER BY AcountNo Desc ", conn); GridView1.DataSource = objcmd.ExecuteReader(); } else { SqlCommand objcmd = new SqlCommand("select [AcountNo],[Status],[Comments],[EmployeeName] ,[UserType] ,[Designation],[BranchName],[Date] from View_LoanAplicationCommentsAll where Autherised_UserID= '" + Session["userID"] + "' and AcountNo = '" + txtAccount.Text + "' ORDER BY AcountNo Desc ", conn); GridView1.DataSource = objcmd.ExecuteReader(); } } GridView1.DataBind(); GridView1.EditIndex = -1; }
protected void Page_Load(object sender, EventArgs e) { if (Session["user"] != null) { ReturnVal oRtnValue = new ReturnVal(); string BranchName = oRtnValue.ReturnValue("View_BranchInfo", "userid", "'" + Session["userID"] + "'", "BranchName"); string EmployeeName = oRtnValue.ReturnValue("View_BranchInfo", "userid", "'" + Session["userID"] + "'", "EmployeeName"); Label1.Text = "Branch/Division: " + BranchName; //Label1.Text = BranchName; Label2.Text = "User Name: " + EmployeeName; Label1.Font.Bold = true; Label1.Font.Italic = false; Label1.Font.Name = "verdana"; Label1.Font.Overline = false; Label1.Font.Size = 10; Label1.Font.Strikeout = false; Label1.Font.Underline = false; Label2.Font.Name = "verdana"; } if (Session["user"] == null) { Server.Transfer("WebLogin.aspx"); } if (!IsPostBack) { string condition = " where userID='" + Session["user"].ToString() + "'"; DataTable dt = oUserInfoDAO.GetUserInfo(condition); string userType = ""; if (dt.Rows.Count > 0) { userType = dt.Rows[0]["UserType"].ToString(); if (userType != "Admin") { condition = " where userID='" + Session["user"].ToString() + "'"; DataTable dt1 = oUserAssignRightDAO.GetUserAssignRight(condition); SubMenuEntity oMenu = new SubMenuEntity(); for (int k = 0; k < NavigationMenu.Items.Count; k++) { if (NavigationMenu.Items[k].Text == "Admin") { NavigationMenu.Items[k].Enabled = false; } foreach (MenuItem item in NavigationMenu.Items[k].ChildItems) { // Display the menu items. DisplayChildMenuText(item, dt1); } } } } } }
protected void btnUpload_Click(object sender, EventArgs e) { HttpFileCollection files = Request.Files; foreach (string fileTagName in files) { HttpPostedFile file = Request.Files[fileTagName]; if (file.ContentLength > 0) { // Due to the limit of the max for a int type, the largest file can be // uploaded is 2147483647, which is very large anyway. int size = file.ContentLength; string userid = Session["user"].ToString(); //string name = file.FileName + "," + userid; string name = file.FileName; int position = name.LastIndexOf("\\"); name = name.Substring(position + 1); string contentType = file.ContentType; byte[] fileData = new byte[size]; file.InputStream.Read(fileData, 0, size); string[] a = name.Split('.'); string Aplication = a[0].ToString(); ReturnVal oRtnValue = new ReturnVal(); string ApplicationHave = oRtnValue.ReturnValue("LoanAplication", "AcountNo", "'" + Aplication + "'", "AcountNo"); if (ApplicationHave == "") { ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "MessageBox", "alert('Submit Aplication First and Make file Name same as Aplication No')", true); return; } string filecount = oRtnValue.ReturnValue("Files", "AcountNo", "'" + Aplication + "'", "count(*)"); string NameWithVersion = a[0].ToString() + "." + "" + filecount + "." + a[1].ToString(); using (SqlConnection connection = new SqlConnection()) { OpenConnection(connection); SqlCommand cmd = new SqlCommand(); cmd.Connection = connection; cmd.CommandTimeout = 0; //string user = Session["userID"].tostring(); string commandText = "INSERT INTO Files (Name,ContentType,Size,Data,Cdate,userid,brCode,AcountNo) VALUES(@Name, @ContentType, "; commandText = commandText + "@Size, @Data,@Cdate,@userid,@brCode,@AcountNo)"; cmd.CommandText = commandText; cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@Name", SqlDbType.NVarChar, 100); cmd.Parameters.Add("@ContentType", SqlDbType.VarChar, 50); cmd.Parameters.Add("@size", SqlDbType.Int); cmd.Parameters.Add("@Data", SqlDbType.VarBinary); cmd.Parameters.Add("@Cdate", SqlDbType.Date); cmd.Parameters.Add("@userid", SqlDbType.NVarChar, 25); cmd.Parameters.Add("@brCode", SqlDbType.NVarChar, 3); cmd.Parameters.Add("@AcountNo", SqlDbType.NVarChar, 25); //string[] a = name.Split(',');AcountNo cmd.Parameters["@Name"].Value = NameWithVersion; cmd.Parameters["@ContentType"].Value = contentType; cmd.Parameters["@size"].Value = size; cmd.Parameters["@Data"].Value = fileData; cmd.Parameters["@Cdate"].Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); cmd.Parameters["@userid"].Value = userid; cmd.Parameters["@brCode"].Value = name.Substring(3, 3); cmd.Parameters["@AcountNo"].Value = Aplication; cmd.ExecuteNonQuery(); connection.Close(); } } } DataTable fileList = GetFileList(Session["user"].ToString()); gvFiles.DataSource = fileList; gvFiles.DataBind(); }
public static T Data <T>(this ReturnVal <T> ret) { if (ret.Result is null or { Count : <= 0 })
protected void btnDocSavee_Click(object sender, EventArgs e) { ReturnVal oRtnValue = new ReturnVal(); string Cont = oRtnValue.ReturnValue("LoanAplication", "AcountNo", "'" + txtAccount.Text + "'", "AcountNo"); //string Doc = oRtnValue.ReturnValue("LoanDocumentChecklist", "AcountNo", "'" + txtAccount.Text + "'and DocName='" + drpLoanDocument.Text + "' ", "DocName"); string Doc = null; if (drpLoanDocument.Text != "Others") { Doc = oRtnValue.ReturnValue("LoanDocumentChecklist", "AcountNo", "'" + txtAccount.Text + "'and DocName='" + drpLoanDocument.Text + "' ", "DocName"); } else { Doc = oRtnValue.ReturnValue("LoanDocumentChecklist", "AcountNo", "'" + txtAccount.Text + "'and DocName='" + txtDocName.Text + "' ", "DocName"); } if (Cont == "") { ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "MessageBox", "alert('Please Enter Valid Aplication No.')", true); } else { //string Doc = oRtnValue.ReturnValue("LoanDocumentChecklist", "AcountNo", "'" + txtAccount.Text + "'and DocName='" + drpLoanDocument.Text + "' ", "DocName"); if ((drpLoanDocument.Text == "--Select--") || (Doc == drpLoanDocument.Text) || (drpLoanDocument.Text == "Others" && Doc == txtDocName.Text) || (drpLoanDocument.Text == "Others" && txtDocName.Equals(""))) { ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "MessageBox", "alert('Please Select Valid Document Which Yet Not Recived')", true); } else { if (drpLoanDocument.Text != "Others") { SqlConnection conn = dbconnection.connection(); //SqlCommand objcmd = new SqlCommand("insert into LoanDocumentChecklist (AcountNo,DocName,UserID,Cdate) values ('" + txtAccount.Text + "','" + drpLoanDocument.Text + "','" + Session["userID"] + "','" + DateTime.Now + "')", conn); SqlCommand objcmd = new SqlCommand("insert into LoanDocumentChecklist (AcountNo,DocName,UserID,Cdate) values ('" + txtAccount.Text + "','" + drpLoanDocument.Text + "','" + Session["userID"] + "','" + DateTime.Now.ToString("MM/dd/yyyy HH:MM") + "')", conn); objcmd.ExecuteNonQuery(); conn.Close(); } else { SqlConnection conn = dbconnection.connection(); //SqlCommand objcmd = new SqlCommand("insert into LoanDocumentChecklist (AcountNo,DocName,UserID,Cdate) values ('" + txtAccount.Text + "','" + drpLoanDocument.Text + "','" + Session["userID"] + "','" + DateTime.Now + "')", conn); SqlCommand objcmd = new SqlCommand("insert into LoanDocumentChecklist (AcountNo,DocName,UserID,Cdate) values ('" + txtAccount.Text + "','" + txtDocName.Text + "','" + Session["userID"] + "','" + DateTime.Now.ToString("MM/dd/yyyy HH:MM") + "')", conn); objcmd.ExecuteNonQuery(); conn.Close(); } GridLoad(); GridView1.EditIndex = -1; } } //string message = "Data Save Successfully. "; //ClientScript.RegisterStartupScript(GetType(), "alert", "alert('" + message + "');", true); }