예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["ChetanaCompanyName"] != null)
        {
            if (Session["FY"] != null)
            {
                strChetanaCompanyName = Session["ChetanaCompanyName"].ToString();
                strFY = Session["FY"].ToString();
            }
            else
            {
                Session.Clear();
            }
            //Response.Write(strFY);
        }

        if (!Page.IsPostBack)
        {
            //GrdJV.DataBind();
            TxtdocDate.Text       = DateTime.Now.ToString("dd/MM/yyyy");
            Session["tempJVData"] = null;
            btnSave.Visible       = false;
            Txtdocno.Focus();
            // Txtdebitamt.Text = "0";
            //Txtcreditamt.Text = "0";
        }
    }
예제 #2
0
    public void getdata()
    {
        sdocno = Txtdocno.Text.Trim();
        DocNo  = Convert.ToInt32(sdocno);
        //string from = txtfromDate.Text.Split('/')[2] + "/" + txtfromDate.Text.Split('/')[1] + "/" + txtfromDate.Text.Split('/')[0];
        //string To = txttoDate.Text.Split('/')[2] + "/" + txttoDate.Text.Split('/')[1] + "/" + txttoDate.Text.Split('/')[0];
        //fdate = Convert.ToDateTime(from);
        //tdate = Convert.ToDateTime(To);
        //if (fdate > tdate)
        //{
        //    MessageBox("From Date is Greater than ToDate");
        //    txtfromDate.Focus();
        //}
        //else

        DataTable dt = new DataTable();

        //dt = Books.Get_Bookwise_summary(fdate, tdate).Tables[0];
        dt = DNDetail.RepGetDN(DocNo, Convert.ToInt32(strFY)).Tables[0];
        if (dt.Rows.Count > 0)
        {
            ReportDocument CR = new ReportDocument();
            CR.Load(Server.MapPath("Report/PrintDN.rpt"));
            CrptDN.SeparatePages = false;
            CR.SetDataSource(dt);
            CrptDN.ReportSource = CR;
        }
        else
        {
            MessageBox("No Records Found");
            Txtdocno.Focus();
        }
    }
예제 #3
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     if (Session["UserName"] != null)
     {
         try
         {
             JVMaster objjdel = new JVMaster();
             int      docno1  = Convert.ToInt32(Txtdocno.Text.Trim());
             int      JVMID1  = Convert.ToInt32(LblJVMasterID.Text.Trim());
             objjdel.JVMasterID = JVMID1;
             objjdel.JVDocNo    = docno1;
             objjdel.UpdatedBy  = Session["UserName"].ToString();
             objjdel.strFY      = Convert.ToInt32(strFY);
             objjdel.DeleteJV();
             MessageBox("Record Deleted Successfully " + (Txtdocno.Text));
             //MessageBox("Record saved successfully");
             GrdJV.DataBind();
             btnDelete.Visible = false;
             Txtdocno.Text     = "";
             Txtdocno.Focus();
         }
         catch
         {
         }
     }
 }
예제 #4
0
    protected void Txtdocno_TextChanged(object sender, EventArgs e)
    {
        string    DocNost = Txtdocno.Text.Trim();
        int       DocNo2  = Convert.ToInt32(DocNost);
        int       strFY2  = Convert.ToInt32(strFY);
        DataTable dt1     = new DataTable();

        dt1 = JVDetail.GetJV(DocNo2, strFY2).Tables[2];

        if (dt1.Rows.Count != 0)
        {
            //TxtCmpycode.Text = "";
            //TxtBookcode.Text = "";
            //LblBookName.Text = "";
            //Txtdocno.Text = "";
            PnllGrdJv.Visible  = true;
            btnDelete.Visible  = true;
            TxtdocDate.Text    = Convert.ToString(JVDetail.GetJV(DocNo2, strFY2).Tables[0].Rows[0]["JVDocDate"]);
            LblJVMasterID.Text = Convert.ToString(JVDetail.GetJV(DocNo2, strFY2).Tables[0].Rows[0]["JVMasterID"]);

            GrdJV.DataSource = JVDetail.GetJV(DocNo2, strFY2).Tables[2];
            GrdJV.DataBind();
            btnDelete.Focus();
        }
        else
        {
            MessageBox("Invalid Document No.");
            btnDelete.Visible = false;
            PnllGrdJv.Visible = false;
            //TxtdocDate.Text = DateTime.Now.ToString("dd/MM/yyyy");
            //GrdJV.DataSource = JVDetail.GetJV(DocNo2, strFY2).Tables[2];
            //GrdJV.DataBind();
            Txtdocno.Focus();
        }
    }
예제 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["ChetanaCompanyName"] != null)
     {
         if (Session["FY"] != null)
         {
             strChetanaCompanyName = Session["ChetanaCompanyName"].ToString();
             strFY = Session["FY"].ToString();
         }
         else
         {
             Session.Clear();
         }
         //Response.Write(strFY);
     }
     if (!Page.IsPostBack)
     {
         Txtdocno.Focus();
     }
 }
예제 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (ConfigurationManager.AppSettings["access"].ToString() != ConfigurationManager.AppSettings["accessok"].ToString())
        //{
        //    string page = Request.Url.Segments[Request.Url.Segments.Length - 1].ToString();
        //    if (Session["Role"] != null)
        //    {
        //        if (!Other.Get_UserAccess(page, Session["Role"].ToString()))
        //        {
        //            Response.Redirect("dashboard.aspx");
        //        }

        //    }
        //}

        if (Session["ChetanaCompanyName"] != null)
        {
            if (Session["FY"] != null)
            {
                strChetanaCompanyName = Session["ChetanaCompanyName"].ToString();
                strFY = Session["FY"].ToString();
            }
            else
            {
                Session.Clear();
            }
            //Response.Write(strFY);
        }

        Txtdocno.Focus();

        //if (txtfromDate.Text != "" || txttoDate.Text != "")
        //{
        //    getdata();
        //}

        if (Txtdocno.Text != "")
        {
            getdata();
        }
    }