protected void Page_Load(object sender, EventArgs e)
    {
        LoanDSTableAdapters.PDCTableAdapter loanApp = new LoanDSTableAdapters.PDCTableAdapter();
        //txtLoanAmt.Value = Convert.ToString(loanApp.Get(MySessionManager.AppID, MySessionManager.ClientID)).ToString();

        if (!(Request.QueryString["pedit"] == null))
        {
            type = "update";
            id   = Convert.ToInt32(Request.QueryString["pedit"]);
            if (!(this.editskip.Value == "2"))
            {
                loadpdc(id);
            }
        }
        else if (!(Request.QueryString["pdelete"] == null))
        {
            try
            {
                string id = Request.QueryString["pdelete"];
                util.deleteItem("tbl_pdc", id);

                Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "pdelete"));
            }
            catch
            { }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
       

        LoanDSTableAdapters.PDCTableAdapter  loanApp = new LoanDSTableAdapters.PDCTableAdapter();
        //txtLoanAmt.Value = Convert.ToString(loanApp.Get(MySessionManager.AppID, MySessionManager.ClientID)).ToString();

        if (!(Request.QueryString["pedit"] == null))
        {
            type = "update";
            id = Convert.ToInt32(Request.QueryString["pedit"]);
            if (!(this.editskip.Value == "2"))
            {
                loadpdc(id);
            }
        }
        else if (!(Request.QueryString["pdelete"] == null))
        {
            try
            {
                string id = Request.QueryString["pdelete"];
                util.deleteItem("tbl_pdc", id);

                Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "pdelete"));
            }
            catch
            { }
        }
    }
예제 #3
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        LoanDSTableAdapters.PDCTableAdapter pdc = new LoanDSTableAdapters.PDCTableAdapter();
        CultureInfo ukCulture = new CultureInfo("en-GB");
        // pass the DateTimeFormat information to DateTime.Parse
        DateTime dt = DateTime.Parse(txtDate.Text, ukCulture.DateTimeFormat);

        pdc.UpdatePDC1(txtBank.Value.Trim(),
                       dt,
                       txtchequeno.Value.Trim(),
                       Convert.ToDecimal(txtAmt.Value.Trim()),
                       1,
                       id);
    }
예제 #4
0
    public void loadPDC(int id)
    {
        LoanDSTableAdapters.PDCTableAdapter pdc = new LoanDSTableAdapters.PDCTableAdapter();
        LoanDS.PDCDataTable tblPDC = pdc.GetPDCDetails(id);

        if (tblPDC.Rows.Count > 0)
        {
            txtAmt.Value        = tblPDC[0].datAmount.ToString();
            txtchequeno.Value   = tblPDC[0].datCheque.ToString();
            txtBank.Value       = tblPDC[0].datBank.ToString();
            txtDate.Text        = tblPDC[0].datDate.ToString("dd-MM-yyyy");
            this.editskip.Value = "2";
        }
    }
예제 #5
0
    public bool clearCheque(int id)
    {
        bool cleared = false;

        try
        {
            LoanDSTableAdapters.PDCTableAdapter pdc = new LoanDSTableAdapters.PDCTableAdapter();
            pdc.UpdateClearedCheque(1, id);
            ShowMessageBox("Cheque has been cleared successfully");
            cleared = true;
        }
        catch (Exception ex) { ShowMessageBox("Error!! Cheque was  not cleared"); }


        return(cleared);
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            try
            {
                // fetch the en-GB culture
                CultureInfo ukCulture = new CultureInfo("en-GB");
                // pass the DateTimeFormat information to DateTime.Parse
                DateTime dt = DateTime.Parse(txtDate.Text, ukCulture.DateTimeFormat);
                LoanDSTableAdapters.PDCTableAdapter pdc = new LoanDSTableAdapters.PDCTableAdapter();
                if (!(type == "update"))
                {

                    pdc.InsertPDC(MySessionManager.ClientID,
                                  MySessionManager.AppID,
                                  txtBank.Value.Trim(),
                                  dt,
                                  txtchequeno.Value.Trim(),
                                  Convert.ToDecimal(txtAmt.Value.Trim()),
                                  0,
                                  MySessionManager.CurrentUser.UserID);
                }
                else if (type == "update")
                {
                    pdc.UpdatePDC(txtBank.Value.Trim(),
                                  dt,
                                  txtchequeno.Value.Trim(),
                                  Convert.ToDecimal(txtAmt.Value.Trim()),
                                  0,
                                  MySessionManager.CurrentUser.UserID,
                                  MySessionManager.ClientID,
                                  MySessionManager.AppID);
                }

                Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "pedit"));
            }
            catch (Exception ex) { }

        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            try
            {
                // fetch the en-GB culture
                CultureInfo ukCulture = new CultureInfo("en-GB");
                // pass the DateTimeFormat information to DateTime.Parse
                DateTime dt = DateTime.Parse(txtDate.Text, ukCulture.DateTimeFormat);
                LoanDSTableAdapters.PDCTableAdapter pdc = new LoanDSTableAdapters.PDCTableAdapter();
                if (!(type == "update"))
                {
                    pdc.InsertPDC(MySessionManager.ClientID,
                                  MySessionManager.AppID,
                                  txtBank.Value.Trim(),
                                  dt,
                                  txtchequeno.Value.Trim(),
                                  Convert.ToDecimal(txtAmt.Value.Trim()),
                                  0,
                                  MySessionManager.CurrentUser.UserID);
                }
                else if (type == "update")
                {
                    pdc.UpdatePDC(txtBank.Value.Trim(),
                                  dt,
                                  txtchequeno.Value.Trim(),
                                  Convert.ToDecimal(txtAmt.Value.Trim()),
                                  0,
                                  MySessionManager.CurrentUser.UserID,
                                  MySessionManager.ClientID,
                                  MySessionManager.AppID);
                }

                Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "pedit"));
            }
            catch (Exception ex) { }
        }
    }
    public void loadpdc(int id)
    {
        LoanDSTableAdapters.PDCTableAdapter  pdc = new LoanDSTableAdapters.PDCTableAdapter();
        LoanDS.PDCDataTable tblPDC = pdc.GetPDCDetails(id);

        if (tblPDC.Rows.Count > 0)
        {
            txtAmt.Value = tblPDC[0].datAmount.ToString();
            txtchequeno.Value = tblPDC[0].datCheque.ToString();
            txtBank.Value = tblPDC[0].datBank.ToString();
            txtDate.Text = tblPDC[0].datDate.ToString("dd-MM-yyyy");
            this.editskip.Value="2";
        }
    
    }
    public bool clearCheque(int id) 
    {
        bool cleared = false;
        try 
        {
            LoanDSTableAdapters.PDCTableAdapter pdc = new LoanDSTableAdapters.PDCTableAdapter();
            pdc.UpdateClearedCheque(1, id);
            ShowMessageBox("Cheque has been cleared successfully");
            cleared = true;
        }
        catch (Exception ex) { ShowMessageBox("Error!! Cheque was  not cleared"); }


        return cleared;
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        LoanDSTableAdapters.PDCTableAdapter pdc = new LoanDSTableAdapters.PDCTableAdapter();
        CultureInfo ukCulture = new CultureInfo("en-GB");
        // pass the DateTimeFormat information to DateTime.Parse
        DateTime dt = DateTime.Parse(txtDate.Text, ukCulture.DateTimeFormat);

        pdc.UpdatePDC1(txtBank.Value.Trim(),
                      dt,
                      txtchequeno.Value.Trim(),
                      Convert.ToDecimal(txtAmt.Value.Trim()),
                      1,
                      id);
        
    }