Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Page.IsPostBack == false)
     {
         if (Request.QueryString["lccod"] == null)
         {
             Response.Redirect("frmsrcles.aspx");
         }
         else
         {
             Educom.clslescol obj = new Educom.clslescol();
             DataSet          ds  = obj.lescoldet(Convert.ToInt32(Request
                                                                  .QueryString["lccod"]));
             Label1.Text     = ds.Tables[0].Rows[0]["lescoltit"].ToString();
             Label2.Text     = Convert.ToDateTime(ds.Tables[0].Rows[0]["lescoldat"]).ToShortDateString();
             Label3.Text     = "$" + ds.Tables[0].Rows[0]["lescolcst"].ToString();
             Label4.Text     = ds.Tables[0].Rows[0]["nor"].ToString();
             Label5.Text     = ds.Tables[0].Rows[0]["catnam"].ToString();
             Literal1.Text   = ds.Tables[0].Rows[0]["lescolsec"].ToString();
             Literal2.Text   = ds.Tables[0].Rows[0]["lescoldsc"].ToString();
             Image1.ImageUrl = "~/lescol/" + ds.Tables[0].Rows[0]["lescolcod"].ToString()
                               + ds.Tables[0].Rows[0]["lescolpic"].ToString();
             Image2.ImageUrl = "~/prfpics/" + ds.Tables[0].Rows[0]["prfcod"].ToString()
                               + ds.Tables[0].Rows[0]["prfpic"].ToString();
             Label6.Text          = ds.Tables[0].Rows[0]["nam"].ToString();
             Label7.Text          = ds.Tables[0].Rows[0]["prfdsc"].ToString();
             DataList1.DataSource = obj.dspusrlescol(
                 Convert.ToInt32(ds.Tables[0].Rows[0]["prfcod"]),
                 Convert.ToInt32(Request.QueryString["lccod"]));
             DataList1.DataBind();
         }
     }
 }
Exemple #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["colcod"] == null)
     {
         Response.Redirect("frmprf.aspx");
     }
     else
     {
         Educom.clslescol           obj = new Educom.clslescol();
         List <Educom.clslescolprp> k   = obj.find_rec(Convert.ToInt32(Session["colcod"]));
         Label1.Text = k[0].lescoltit;
     }
 }
Exemple #3
0
 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.Header)
     {
         Educom.clscat           obj = new Educom.clscat();
         List <Educom.clscatprp> k   = obj.find_rec(Convert.ToInt32
                                                        (Request.QueryString["ccod"]));
         Educom.clslescol obj1 = new Educom.clslescol();
         DataSet          ds   = obj1.srclescol(k[0].catcod);
         Label            lbl  = (Label)(e.Row.FindControl("Label1"));
         lbl.Text = k[0].catnam + " (" +
                    ds.Tables[0].Rows.Count.ToString() + ")";
     }
 }
Exemple #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Page.IsPostBack == false)
     {
         if (Request.QueryString["ccod"] == null)
         {
             Response.Redirect("frmmycol.aspx");
         }
         else
         {
             Educom.clslescol           obj = new Educom.clslescol();
             List <Educom.clslescolprp> k   = obj.find_rec(Convert
                                                           .ToInt32(Request.QueryString["ccod"]));
             Label1.Text = k[0].lescoltit;
         }
     }
 }
Exemple #5
0
 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     Educom.clslescol    obj    = new Educom.clslescol();
     Educom.clslescolprp objprp = new Educom.clslescolprp();
     objprp.lescolcod = Convert.ToInt32(GridView1.DataKeys
                                        [e.RowIndex][0]);
     if (Convert.ToChar(GridView1.DataKeys[e.RowIndex][1])
         == 'P')
     {
         objprp.lescolpubsts = 'N';
     }
     else
     {
         objprp.lescolpubsts = 'P';
     }
     obj.updlescolsts(objprp);
     GridView1.DataBind();
     e.Cancel = true;
 }
Exemple #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Educom.clslescol obj = new Educom.clslescol();
        DataSet          ds  = obj.lescoldet(Convert.ToInt32
                                                 (Session["colcod"]));

        //Label1.Text = ds.Tables[0].Rows[0]["lescoltit"].ToString();
        Label2.Text     = Convert.ToDateTime(ds.Tables[0].Rows[0]["lescoldat"]).ToShortDateString();
        Label3.Text     = "$" + ds.Tables[0].Rows[0]["lescolcst"].ToString();
        Label4.Text     = ds.Tables[0].Rows[0]["nor"].ToString();
        Label5.Text     = ds.Tables[0].Rows[0]["catnam"].ToString();
        Literal1.Text   = ds.Tables[0].Rows[0]["lescolsec"].ToString();
        Literal2.Text   = ds.Tables[0].Rows[0]["lescoldsc"].ToString();
        Image1.ImageUrl = "~/lescol/" + ds.Tables[0].Rows[0]["lescolcod"].ToString()
                          + ds.Tables[0].Rows[0]["lescolpic"].ToString();
        Image2.ImageUrl = "~/prfpics/" + ds.Tables[0].Rows[0]["prfcod"].ToString()
                          + ds.Tables[0].Rows[0]["prfpic"].ToString();
        Label6.Text = ds.Tables[0].Rows[0]["nam"].ToString();
        Label7.Text = ds.Tables[0].Rows[0]["prfdsc"].ToString();
    }
Exemple #7
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        Educom.clslescol    obj    = new Educom.clslescol();
        Educom.clslescolprp objprp = new Educom.clslescolprp();
        objprp.lescoltit    = TextBox1.Text;
        objprp.lescoldsc    = TextBox2.Text;
        objprp.lescolsec    = TextBox4.Text;
        objprp.lescolusrcod = Convert.ToInt32(Session["cod"]);
        objprp.lescolcatcod = Convert.ToInt32(DropDownList1
                                              .SelectedValue);
        objprp.lescolcst = Convert.ToSingle(TextBox3.Text);
        objprp.lescoldat = DateTime.Now;
        if (CheckBox1.Checked == true)
        {
            objprp.lescolpubsts = 'P';
        }
        else
        {
            objprp.lescolpubsts = 'N';
        }
        String s = FileUpload1.PostedFile.FileName;

        if (s != "")
        {
            s = s.Substring(s.LastIndexOf('.'));
        }
        objprp.lescolpic = s;
        Int32 a = obj.save_rec(objprp);

        if (s != "")
        {
            FileUpload1.PostedFile.SaveAs(
                Server.MapPath("../lescol") + "//" + a.ToString() + s);
        }
        Response.Redirect("frmmycol.aspx");
    }