Esempio n. 1
0
    public static string checkCatName(string CatName)
    {
        string returnValue = "1";

        try
        {
            DAccess2 dd       = new DAccess2();
            string   cat_name = CatName;
            if (cat_name.Trim() != "" && cat_name != null)
            {
                string querycatname = dd.GetFunction("select distinct category_code,category_name from staffcategorizer where category_name='" + cat_name + "' and college_code='" + autocol + "'");
                if (querycatname.Trim() == "" || querycatname == null || querycatname == "0" || querycatname == "-1")
                {
                    returnValue = "0";
                }
            }
            else
            {
                returnValue = "2";
            }
        }
        catch (SqlException ex)
        {
            returnValue = "error" + ex.ToString();
        }
        return(returnValue);
    }
    public static string CheckUserName(string MenuName)
    {
        string returnValue = "1";

        try
        {
            DAccess2 dd        = new DAccess2();
            string   user_name = MenuName;
            if (user_name.Trim() != "" && user_name != null)
            {
                string query = dd.GetFunction("select distinct MenuName,MenuMasterPK from HM_MenuMaster where MenuName ='" + user_name + "'");
                if (query.Trim() == "" || query == null || query == "0" || query == "-1")
                {
                    returnValue = "0";
                }
            }
            else
            {
                returnValue = "2";
            }
        }
        catch (SqlException ex)
        {
            returnValue = "error" + ex.ToString();
        }
        return(returnValue);
    }
    public void bindsections()
    {
        Connection();
        DAccess2 das = new DAccess2();
        DataSet  dss = new DataSet();

        ht.Clear();
        ht.Add("batch_year", ddlBatch.SelectedItem.Text.ToString());
        ht.Add("degree_code", ddlBranch.SelectedValue.ToString());
        dss = das.select_method("bind_sec", ht, "sp");
        if (dss.Tables[0].Rows.Count > 0)
        {
            ddlSection.Enabled = true;
            ddlSection.Items.Clear();
            ddlSection.Items.Insert(0, new ListItem("All", "0"));
            for (int i = 0; i < dss.Tables[0].Rows.Count; i++)
            {
                ddlSection.Items.Add(dss.Tables[0].Rows[i]["sections"].ToString());
            }
        }
        else
        {
            ddlSection.Items.Insert(0, new ListItem("All", "0"));
            ddlSection.Enabled = false;
        }
    }
    public void binddegree()
    {
        Connection();
        usercode = Session["usercode"].ToString();
        DAccess2 da1        = new DAccess2();
        DataSet  ds1        = new DataSet();
        string   singleuser = Session["single_user"].ToString();
        string   group_user = Session["group_code"].ToString();

        if (group_user.Contains(';'))
        {
            string[] group_semi = group_user.Split(';');
            group_user = group_semi[0].ToString();
        }
        ht.Clear();
        ht.Add("college_code", Session["collegecode"].ToString());
        ht.Add("User_code", usercode);
        ht.Add("single_user", singleuser);
        ht.Add("group_code", group_user);
        ds1 = da1.select_method("bind_degree", ht, "sp");
        if (ds1.Tables[0].Rows.Count > 0)
        {
            ddlDegree.Enabled = true;
            ddlDegree.Items.Clear();
            for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
            {
                ddlDegree.Items.Insert(i, new ListItem(ds1.Tables[0].Rows[i]["course_name"].ToString(), ds1.Tables[0].Rows[i]["course_id"].ToString()));
            }
        }
        else
        {
            ddlDegree.Enabled = false;
        }
    }
    public void bindSem1()
    {
        Connection();
        DAccess2 das = new DAccess2();
        DataSet  dss = new DataSet();

        ht.Clear();
        ht.Add("batch_year", ddlBatch.SelectedItem.Text.ToString());
        ht.Add("college_code", Session["collegecode"].ToString());
        ht.Add("degree_code", ddlBranch.SelectedValue.ToString());
        dss = das.select_method("bind_sem", ht, "sp");
        if (dss.Tables[0].Rows.Count > 0)
        {
            ddlSem.Enabled = true;
            ddlSem.Items.Clear();
            for (int i = 1; i <= Convert.ToInt16(dss.Tables[0].Rows[0]["duration"].ToString()); i++)
            {
                ddlSem.Items.Add(i.ToString());
            }
        }
        else
        {
            ddlSem.Enabled = false;
        }
    }
    public static string checkGroupName(string grpname)
    {
        string returnValue = "1";

        try
        {
            DAccess2 dd       = new DAccess2();
            string   grp_name = grpname;
            if (grp_name.Trim() != "" && grp_name != null)
            {
                string queryledname = dd.GetFunction("select distinct GroupName,FinGroupPK from FM_FinGroupMaster where GroupName='" + grp_name + "' and CollegeCode=" + collegestat + "");
                if (queryledname.Trim() == "" || queryledname == null || queryledname == "0" || queryledname == "-1")
                {
                    returnValue = "0";
                }
            }
            else
            {
                returnValue = "2";
            }
        }
        catch (SqlException ex)
        {
            returnValue = "error" + ex.ToString();
        }
        return(returnValue);
    }
    public void inservalue()
    {
        DAccess2 dacc       = new DAccess2();
        string   batchquery = string.Empty;


        string collegeCode  = ddlCollege.SelectedItem.Value;
        string isvocational = Radioformat1.Checked ? "1" : "0";

        string batch = ddlbatch.SelectedItem.Value;

        string degree = ddlbranch.SelectedItem.Value;



        if (txtsubject.Text == "" && txtcommunity.Text == "")
        {
            lblAlertMsg.Visible = true;
            lblAlertMsg.Text    = "Enter The value of subject and community";
            divPopAlert.Visible = true;

            txtsubject.Visible   = false;
            txtcommunity.Visible = false;
        }
        string sql = "if exists(select  * from stu_eligiblemaster where deg_code='" + degree + "' and isVocational='" + isvocational + "' and batch_year='" + batch + "' ) update stu_eligiblemaster set colleg_code='" + collegeCode + "',batch_year='" + batch + "',deg_code='" + degree + "',isVocational='" + isvocational + "',subject='" + txtsubject.Text + "',Community='" + txtcommunity.Text + "',formula='" + foumla.Text + "',fomulavalue='" + TextBox2.Text + "' where batch_year='" + batch + "' and isVocational='" + isvocational + "' and colleg_code='" + collegeCode + "'else insert into stu_eligiblemaster(colleg_code ,batch_year ,deg_code,isVocational,subject , Community ,formula,fomulavalue ) values('" + collegeCode + "','" + batch + "','" + degree + "','" + isvocational + "','" + txtsubject.Text + "','" + txtcommunity.Text + "','" + foumla.Text + "','" + TextBox2.Text + "') ";

        dacc.update_method_wo_parameter(sql, "text");
        //int result = d2.update_method_wo_parameter(splhr_query_master, "text");


        ddlbatch.SelectedIndex   = 0;
        ddldegree.SelectedIndex  = 0;
        ddlbranch.SelectedIndex  = 0;
        ddlCollege.SelectedIndex = 0;
    }
    public void community()
    {
        string   str        = string.Empty;
        string   str2       = string.Empty;
        string   strname    = string.Empty;
        DAccess2 d2         = new DAccess2();
        string   batchquery = string.Empty;

        foreach (GridViewRow gvrow in GridView1.Rows)
        {
            CheckBox chk = (CheckBox)gvrow.FindControl("cbSelect2");
            if (chk != null & chk.Checked)
            {
                //str += "" + gvrow.Cells[1].Text + "";


                str += d2.GetFunction("select  MAX (TextCode) from textvaltable where TextCriteria='comm' and textval<>''  and college_code ='" + ddlCollege.SelectedItem.Value + "' and textval='" + gvrow.Cells[1].Text + "' ");
                //ds.Clear();


                str += "=";
                str += (gvrow.FindControl("TextBox1") as TextBox).Text;
                str += "/";
            }
        }



        txtcommunity.Text = str;
    }
Esempio n. 9
0
    public static string checkCatAcr(string CatAcr)
    {
        string returnValue = "1";

        try
        {
            DAccess2 dd      = new DAccess2();
            string   cat_acr = CatAcr;
            if (cat_acr.Trim() != "" && cat_acr != null)
            {
                string querycatacr = dd.GetFunction("select distinct CategoryAcr,CategoryMasterPK from HRM_CategoryMaster where CategoryAcr='" + cat_acr + "'");
                if (querycatacr.Trim() == "" || querycatacr == null || querycatacr == "0" || querycatacr == "-1")
                {
                    returnValue = "0";
                }
            }
            else
            {
                returnValue = "2";
            }
        }
        catch (SqlException ex)
        {
            returnValue = "error" + ex.ToString();
        }
        return(returnValue);
    }
Esempio n. 10
0
    public static string CheckAbbreviation(string StoreName)
    {
        string returnValue = "1";

        try
        {
            DAccess2 dd        = new DAccess2();
            string   user_name = StoreName;
            if (user_name.Trim() != "" && user_name != null)
            {
                string query = dd.GetFunction("select distinct MarkTypeAcr from CO_MarkMaster  where CollegeCode in('" + clgcode1 + "') and MarkTypeAcr ='" + user_name + "'");
                if (query.Trim() == "" || query == null || query == "0" || query == "-1")
                {
                    returnValue = "0";
                }
            }
            else
            {
                returnValue = "2";
            }
        }
        catch (SqlException ex)
        {
            returnValue = "error" + ex.ToString();
        }
        return(returnValue);
    }
    public static string checkCatAcr(string CatAcr)
    {
        string returnValue = "1";

        try
        {
            DAccess2 dd      = new DAccess2();
            string   cat_acr = CatAcr;
            if (cat_acr.Trim() != "" && cat_acr != null)
            {
                string querycatacr = dd.GetFunction("select distinct shortname,category from leave_category where shortname='" + cat_acr + "' and college_Code='" + autocol + "'");
                if (querycatacr.Trim() == "" || querycatacr == null || querycatacr == "0" || querycatacr == "-1")
                {
                    returnValue = "0";
                }
            }
            else
            {
                returnValue = "2";
            }
        }
        catch (SqlException ex)
        {
            returnValue = "error" + ex.ToString();
        }
        return(returnValue);
    }
    public static string checkAcctName(string acname)
    {
        string returnValue = "1";

        try
        {
            DAccess2 dd      = new DAccess2();
            string   ac_name = acname;
            if (ac_name.Trim() != "" && ac_name != null)
            {
                string queryacname = dd.GetFunction("select distinct FinYearName from FM_FinYearMaster where FinYearName='" + ac_name + "' and CollegeCode=" + collegestat + "");
                if (queryacname.Trim() == "" || queryacname == null || queryacname == "0" || queryacname == "-1")
                {
                    returnValue = "0";
                }
            }
            else
            {
                returnValue = "2";
            }
        }
        catch (SqlException ex)
        {
            returnValue = "error" + ex.ToString();
        }
        return(returnValue);
    }
    public static List <string> Getmenu(string prefixText)
    {
        DAccess2      dn    = new DAccess2();
        DataSet       dw    = new DataSet();
        List <string> name  = new List <string>();
        string        query = "select distinct  MenuCode  from HM_MenuMaster where   MenuCode like '%" + prefixText + "%'";

        dw = dn.select_method_wo_parameter(query, "Text");
        if (dw.Tables[0].Rows.Count > 0)
        {
            for (int i = 0; i < dw.Tables[0].Rows.Count; i++)
            {
                name.Add(dw.Tables[0].Rows[i]["MenuCode"].ToString());
            }
        }
        return(name);
    }
    public static List <string> Getname(string prefixText)
    {
        DAccess2      dn   = new DAccess2();
        DataSet       dw   = new DataSet();
        List <string> name = new List <string>();
        string        sql  = "select TextCode,TextVal from TextValTable where TextCriteria ='Sitem' ";

        dw = dn.select_method_wo_parameter(sql, "Text");
        if (dw.Tables[0].Rows.Count > 0)
        {
            for (int i = 0; i < dw.Tables[0].Rows.Count; i++)
            {
                name.Add(dw.Tables[0].Rows[i]["TextVal"].ToString());
            }
        }
        return(name);
    }
Esempio n. 15
0
    public static List <string> Getitemheader(string prefixText)
    {
        DAccess2      dn    = new DAccess2();
        DataSet       dw    = new DataSet();
        List <string> name  = new List <string>();
        string        query = "select distinct itemheader_name from item_master WHERE itemheader_name like '" + prefixText + "%' ";

        dw = dn.select_method_wo_parameter(query, "Text");
        if (dw.Tables[0].Rows.Count > 0)
        {
            for (int i = 0; i < dw.Tables[0].Rows.Count; i++)
            {
                name.Add(dw.Tables[0].Rows[i]["itemheader_name"].ToString());
            }
        }
        return(name);
    }
    public static List <string> Getname(string prefixText)
    {
        DAccess2      dn    = new DAccess2();
        DataSet       dw    = new DataSet();
        List <string> name  = new List <string>();
        string        query = "select distinct itemname from IT_PurchaseOrder p,IT_PurchaseOrderDetail pd,IM_ItemMaster i where i.ItemPK=pd.ItemFK and p.PurchaseOrderPK=pd.PurchaseOrderFK and itemname like '" + prefixText + "%' ";

        dw = dn.select_method_wo_parameter(query, "Text");
        if (dw.Tables[0].Rows.Count > 0)
        {
            for (int i = 0; i < dw.Tables[0].Rows.Count; i++)
            {
                name.Add(dw.Tables[0].Rows[i]["ItemName"].ToString());
            }
        }
        return(name);
    }
Esempio n. 17
0
    public void btnPrint11()
    {
        DAccess2 ddd2         = new DAccess2();
        string   college_code = Convert.ToString(Session["collegecode"].ToString());
        string   colQ         = "select * from collinfo where college_code='" + college_code + "'";
        DataSet  dsCol        = new DataSet();

        dsCol = ddd2.select_method_wo_parameter(colQ, "Text");
        string collegeName  = string.Empty;
        string collegeCateg = string.Empty;
        string collegeAff   = string.Empty;
        string collegeAdd   = string.Empty;
        string collegePhone = string.Empty;
        string collegeFax   = string.Empty;
        string collegeWeb   = string.Empty;
        string collegeEmai  = string.Empty;
        string collegePin   = string.Empty;
        string acr          = string.Empty;
        string City         = string.Empty;

        if (dsCol.Tables.Count > 0 && dsCol.Tables[0].Rows.Count > 0)
        {
            collegeName  = Convert.ToString(dsCol.Tables[0].Rows[0]["Collname"]);
            City         = Convert.ToString(dsCol.Tables[0].Rows[0]["address3"]);
            collegeAff   = "(Affiliated to " + Convert.ToString(dsCol.Tables[0].Rows[0]["university"]) + ")";
            collegeAdd   = Convert.ToString(dsCol.Tables[0].Rows[0]["address1"]) + " , " + Convert.ToString(dsCol.Tables[0].Rows[0]["address2"]) + " , " + Convert.ToString(dsCol.Tables[0].Rows[0]["district"]) + " - " + Convert.ToString(dsCol.Tables[0].Rows[0]["pincode"]);
            collegePin   = Convert.ToString(dsCol.Tables[0].Rows[0]["pincode"]);
            collegePhone = "OFFICE: " + Convert.ToString(dsCol.Tables[0].Rows[0]["phoneno"]);
            collegeFax   = "FAX: " + Convert.ToString(dsCol.Tables[0].Rows[0]["faxno"]);
            collegeWeb   = "Website: " + Convert.ToString(dsCol.Tables[0].Rows[0]["website"]);
            collegeEmai  = "E-Mail: " + Convert.ToString(dsCol.Tables[0].Rows[0]["email"]);
            collegeCateg = "(" + Convert.ToString(dsCol.Tables[0].Rows[0]["category"]) + ")";
        }
        DateTime dt   = DateTime.Now;
        int      year = dt.Year;

        spCollegeName.InnerHtml = collegeName;
        spAddr.InnerHtml        = collegeAdd;
        spDegreeName.InnerHtml  = acr;
        spReportName.InnerHtml  = "Special Hour Report";
        // spSection.InnerHtml ="Satff: "+ Convert.ToString(ddlSearchOption.SelectedItem.Text);
    }
 //Print and Excel Report
 protected void btnExcel_Click(object sender, EventArgs e)
 {
     try
     {
         string reportname = txtexcelname.Text;
         if (reportname.ToString().Trim() != "")
         {
             DAccess2 DA = new DAccess2();
             DA.printexcelreport(Fpspread1, reportname);
             lblvalidation1.Visible = false;
         }
         else
         {
             lblvalidation1.Text    = "Please Enter Your Report Name";
             lblvalidation1.Visible = true;
             txtexcelname.Focus();
         }
     }
     catch
     {
     }
 }
    public static string applicationNo(string applno)
    {
        string Value = "1";

        try
        {
            if (!string.IsNullOrEmpty(applno) && !string.IsNullOrEmpty(btyr))
            {
                DAccess2 da        = new DAccess2();
                string   applValue = da.GetFunction(" select top 1 r.roll_admit  from Registration r,applyn a where  a.app_no=r.App_No and isnull(a.is_enroll,0) = '2' and  r.roll_admit <>'' and r.roll_admit like '%" + applno + "%' and r.batch_year='" + btyr + "'  and r.college_code='" + clgcode + "' order by r.roll_admit desc");
                if (string.IsNullOrEmpty(applValue) || applValue == "0" || applValue == "-1")
                {
                    Value = "0";
                }
            }
            else
            {
                Value = "2";
            }
        }
        catch (SqlException ex) { Value = "error" + ex.ToString(); }
        return(Value);
    }
    public void bindcollege()
    {
        DAccess2 d2 = new DAccess2();

        try
        {
            ds.Clear();

            ds = d2.BindCollegebaseonrights(Session["usercode"].ToString());
            if (ds.Tables[0].Rows.Count > 0)
            {
                ddl_collegename.DataSource     = ds;
                ddl_collegename.DataTextField  = "collname";
                ddl_collegename.DataValueField = "college_code";
                ddl_collegename.DataBind();
                headerbind();
                ledgerbind();
            }
        }
        catch
        {
        }
    }
    protected void bindsubject()
    {
        if (ddlSubjectType.SelectedItem.Text.ToString() != "All")
        {
            DAccess2 da = new DAccess2();
            DataSet  ds = new DataSet();
            ht.Clear();
            if (ddlSection.SelectedItem.Text.ToString() != "" && ddlSubjectType.SelectedItem.Text.ToString() != "" && ddlBatch.SelectedItem.Text.ToString() != "" && ddlSem.SelectedValue.ToString() != "" && ddlBranch.SelectedValue.ToString() != "")
            {
                ht.Add("CollegeCode", Session["collegecode"].ToString());
                ht.Add("Sections", ddlSection.SelectedItem.Text.ToString());
                ht.Add("Subtype", ddlSubjectType.SelectedItem.Text.ToString());
                ht.Add("BatchYear", ddlBatch.SelectedItem.Text.ToString());
                ht.Add("Semester", ddlSem.SelectedItem.Text.ToString());
                ht.Add("DegreeCode", ddlBranch.SelectedValue.ToString());
                ds = da.select_method("ProcBatchAllocationSubjectDetails", ht, "sp");
                ddlSubject.Items.Clear();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ddlSubject.Enabled = true;
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        ddlSubject.Items.Insert(i, new ListItem(ds.Tables[0].Rows[i]["SubjectName"].ToString(), ds.Tables[0].Rows[i]["SubjectNo"].ToString()));
                    }
                }
                else
                {
                    ddlSubject.Enabled = false;
                }
            }
        }

        else
        {
            DAccess2 da = new DAccess2();
            DataSet  ds = new DataSet();
            ht.Clear();
            if (ddlSection.SelectedItem.Text.ToString() != "" && ddlSubjectType.SelectedItem.Text.ToString() != "" && ddlBatch.SelectedItem.Text.ToString() != "" && ddlSem.SelectedValue.ToString() != "" && ddlBranch.SelectedValue.ToString() != "")
            {
                ht.Add("CollegeCode", Session["collegecode"].ToString());
                ht.Add("Sections", ddlSection.SelectedItem.Text.ToString());
                ht.Add("Subtype", ddlSubjectType.SelectedItem.Text.ToString());
                ht.Add("BatchYear", ddlBatch.SelectedItem.Text.ToString());
                ht.Add("Semester", ddlSem.SelectedItem.Text.ToString());
                ht.Add("DegreeCode", ddlBranch.SelectedValue.ToString());
                ds = da.select_method("ProcBatchAllocationSubjectDetails", ht, "sp");
                ddlSubject.Items.Clear();
                int i = 0;
                if (ds.Tables[0].Rows.Count > 0)
                {
                    for (i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        ddlSubject.Items.Insert(i, new ListItem(ds.Tables[0].Rows[i]["SubjectName"].ToString(), ds.Tables[0].Rows[i]["SubjectNo"].ToString()));
                        //ddlSubject.DataSource = ds;
                        //ddlSubject.DataValueField = "SubjectNo";
                        //ddlSubject.DataTextField = "SubjectName";
                        //ddlSubject.DataBind();
                    }
                }

                if (ds.Tables[1].Rows.Count > 0)
                {
                    ddlSubject.Enabled = true;
                    int n = 0;
                    n = i;
                    for (int j = 0; j < ds.Tables[1].Rows.Count; j++)
                    {
                        ddlSubject.Items.Insert(n, new ListItem(ds.Tables[1].Rows[j]["SubjectName"].ToString(), ds.Tables[1].Rows[j]["SubjectNo"].ToString()));
                        n = n + 1;
                    }
                }

                if (ds.Tables[0].Rows.Count < 1 && ds.Tables[1].Rows.Count < 1)
                {
                    ddlSubject.Enabled = false;
                }
                else
                {
                    ddlSubject.Enabled = true;
                }
            }
        }
    }
Esempio n. 22
0
    public static List <string> studsmartno(string Smart_No)
    {
        string        data    = string.Empty;
        List <string> details = new List <string>();

        try
        {
            if (Smart_No.Trim() != "" && Smart_No.Length >= 10)
            {
                DataSet  ds = new DataSet(); DataSet ds1 = new DataSet(); DataSet ds2 = new DataSet();
                DAccess2 DA = new DAccess2();

                string stud_condition = ""; string staff_condition = "";
                if (chosedmode == 0)
                {
                    stud_condition  = " and smart_serial_no='" + Smart_No + "'";
                    staff_condition = " and Smartcard_serial_no='" + Smart_No + "'";
                    string messatt_settings = "";
                    string q1 = "";
                    System.Web.UI.WebControls.Image lbl_studimage = new System.Web.UI.WebControls.Image();
                    lbl_studimage.ImageUrl = "../images/dummyimg.png"; lbl_studimage.Visible = true;

                    if (stud_condition.Trim() != "")
                    {
                        q1 = " select r.app_no,r.Reg_No,r.college_code ,roll_no,Stud_Name,Stud_Type,r.degree_code,Branch_code,Batch_Year,Sections,((CONVERT(varchar(max), r.Batch_Year)+' - '+C.Course_Name+' - '+dt.dept_acronym+ case when sections='' then '' else ' - '+ (sections) end)) as batch from Registration r,Degree d,Department dt,course c where d.Dept_Code=dt.Dept_Code and c.Course_Id=d.Course_Id and r.degree_code=d.Degree_Code " + stud_condition + " and r.college_code='" + coll_code + "'";
                        ds = DA.select_method_wo_parameter(q1, "Text");
                    }



                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        string rollno = Convert.ToString(ds.Tables[0].Rows[0]["roll_no"]);
                        details.Add(rollno);
                        details.Add(Convert.ToString(ds.Tables[0].Rows[0]["Stud_Name"]));
                        details.Add(Convert.ToString(ds.Tables[0].Rows[0]["Stud_Type"]));
                        details.Add(Convert.ToString(ds.Tables[0].Rows[0]["batch"]));

                        lbl_studimage.Visible = true; string type = "";

                        lbl_studimage.ImageUrl = "../Handler/Handler4.ashx?rollno=" + rollno + "";


                        details.Add(Convert.ToString(lbl_studimage.ImageUrl));

                        string   app_no          = Convert.ToString(ds.Tables[0].Rows[0]["app_no"]);
                        string   clgcode         = Convert.ToString(ds.Tables[0].Rows[0]["college_code"]);
                        DataView alreadyregstud  = new DataView();
                        DataView alreadyregstud1 = new DataView();


                        if (app_no.Trim() != "")
                        {
                            q1 = "";
                            q1 = "if exists(select * from Late_attendance where App_No='" + app_no + "' and FromDate='" + DateTime.Now.ToString("MM/dd/yyyy") + "' and college_code='" + clgcode + "') update Late_attendance set FromTime='" + DateTime.Now.ToString("h:mm:ss tt") + "' where App_No='" + app_no + "' and FromDate='" + DateTime.Now.ToString("MM/dd/yyyy") + "' and college_code='" + clgcode + "' else    insert into Late_attendance (App_No,FromDate,FromTime,college_code,AttnMonth,AttnYear)values('" + app_no + "','" + DateTime.Now.ToString("MM/dd/yyyy") + "','" + DateTime.Now.ToString("h:mm:ss tt") + "','" + clgcode + "','" + DateTime.Now.ToString("MM") + "','" + DateTime.Now.ToString("yyyy") + "')";
                            //q1 = "insert into Late_attendance (App_No,FromDate,FromTime,college_code,AttnMonth,AttnYear)values('" + app_no + "','" + DateTime.Now.ToString("MM/dd/yyyy") + "','" + DateTime.Now.ToString("h:mm:ss tt") + "','" + clgcode + "','" + DateTime.Now.ToString("MM") + "','" + DateTime.Now.ToString("yyyy") + "')";
                            int up = DA.update_method_wo_parameter(q1, "text");
                            if (up != 0)
                            {
                                details.Add("1");
                                details.Add(type);
                            }
                        }


                        q1 = " select * from Late_attendance ";
                        ds1.Clear();
                        ds1 = DA.select_method_wo_parameter(q1, "Text");
                        ds1.Tables[0].DefaultView.RowFilter = "AttnMonth='" + DateTime.Now.ToString("MM") + "' and AttnYear ='" + DateTime.Now.ToString("yyyy") + "' and College_Code='" + clgcode + "' and App_No='" + app_no + "'  ";
                        alreadyregstud1 = ds1.Tables[0].DefaultView;
                        details.Add(Convert.ToString(ds.Tables[0].Rows[0]["Reg_no"]));

                        details.Add(Convert.ToString(alreadyregstud1.Count));
                        if (alreadyregstud1.Count >= 4)
                        {
                            sms(clgcode, app_no, Convert.ToString(ds.Tables[0].Rows[0]["Stud_Name"]), DateTime.Now.ToString("h:mm:ss tt"), DateTime.Now.ToString("MM/dd/yyyy"));
                        }
                    }
                    else
                    {
                        details.Clear();
                        details.Add("");
                        details.Add("");
                        details.Add("");
                        details.Add("");
                        details.Add(Convert.ToString(lbl_studimage.ImageUrl));
                        details.Add("0"); details.Add("");
                    }
                }
            }
            return(details);
        }
        catch
        {
            details.Clear();
            details.Add("");
            details.Add("");
            details.Add("");
            details.Add(""); details.Add("");
            details.Add("0");
            return(details);
        }
    }
Esempio n. 23
0
    //public void load_ddlrollno()
    //{
    //    try
    //    {
    //        System.Web.UI.WebControls.ListItem lst1 = new System.Web.UI.WebControls.ListItem("Roll No", "0");
    //        System.Web.UI.WebControls.ListItem lst2 = new System.Web.UI.WebControls.ListItem("Reg No", "1");
    //        System.Web.UI.WebControls.ListItem lst3 = new System.Web.UI.WebControls.ListItem("Admin No", "2");
    //        System.Web.UI.WebControls.ListItem lst4 = new System.Web.UI.WebControls.ListItem("App No", "3");
    //        System.Web.UI.WebControls.ListItem lst5 = new System.Web.UI.WebControls.ListItem("Name", "4");
    //        System.Web.UI.WebControls.ListItem lst51 = new System.Web.UI.WebControls.ListItem("Hostel Id", "5");

    //        //Roll Number or Reg Number or Admission No or Application Number
    //        ddlrollno.Items.Clear();
    //        string insqry1 = "select value from Master_Settings where settings='Roll No' and usercode ='" + usercode + "' --and college_code ='" + collegecode + "'";

    //        int save1 = Convert.ToInt32(d2.GetFunction(insqry1));

    //        if (save1 == 1)
    //        {
    //            //Roll No
    //            ddlrollno.Items.Add(lst1);
    //        }


    //        insqry1 = "select value from Master_Settings where settings='Register No' and usercode ='" + usercode + "' --and college_code ='" + collegecode + "'";
    //        save1 = Convert.ToInt32(d2.GetFunction(insqry1));
    //        if (save1 == 1)
    //        {
    //            //RegNo
    //            ddlrollno.Items.Add(lst2);
    //        }

    //        insqry1 = "select value from Master_Settings where settings='Admission No' and usercode ='" + usercode + "' --and college_code ='" + collegecode + "'";
    //        save1 = Convert.ToInt32(d2.GetFunction(insqry1));
    //        if (save1 == 1)
    //        {
    //            //Admission No - Roll Admit
    //            ddlrollno.Items.Add(lst3);
    //        }

    //        insqry1 = "select value from Master_Settings where settings='Application No' and usercode ='" + usercode + "' --and college_code ='" + collegecode + "'";
    //        save1 = Convert.ToInt32(d2.GetFunction(insqry1));

    //        if (save1 == 1)
    //        {
    //            //App Form Number - Application Number
    //            ddlrollno.Items.Add(lst4);

    //        }
    //        insqry1 = "select value from Master_Settings where settings='Hostel Id' and usercode ='" + usercode + "' --and college_code ='" + collegecode + "'";
    //        save1 = Convert.ToInt32(d2.GetFunction(insqry1));

    //        if (save1 == 1)
    //        {
    //            //App Form Number - Application Number
    //            ddlrollno.Items.Add(lst51);

    //        }

    //        if (ddlrollno.Items.Count == 0)
    //        {
    //            ddlrollno.Items.Add(lst1);
    //        }
    //        ddlrollno.Items.Add(lst5);
    //        switch (Convert.ToUInt32(ddlrollno.SelectedItem.Value))
    //        {
    //            case 0:
    //                txtno.Attributes.Add("placeholder", "Roll No");
    //                chosedmode = 0;
    //                break;
    //            case 1:
    //                txtno.Attributes.Add("placeholder", "Reg No");
    //                chosedmode = 1;
    //                break;
    //            case 2:
    //                txtno.Attributes.Add("placeholder", "Admin No");
    //                chosedmode = 2;
    //                break;
    //            case 3:
    //                txtno.Attributes.Add("placeholder", "App No");
    //                chosedmode = 3;
    //                break;
    //            case 5:
    //                txtno.Attributes.Add("placeholder", "Hostel Id");
    //                chosedmode = 5;
    //                break;
    //        }


    //    }
    //    catch { }
    //}

    public static void sms(string clgcode, string appno, string outin, string time, string date)
    {
        DAccess2 d2      = new DAccess2();
        DataSet  ds      = new DataSet();//barath21.04.17
        string   user_id = d2.GetFunction("select SMS_User_ID from Track_Value where college_code='" + clgcode + "'");
        //string getval = d2.GetUserapi(user_id);
        //string[] spret = getval.Split('-');
        //if (spret.GetUpperBound(0) == 1)
        //{
        //    SenderID = spret[0].ToString();
        //    Password = spret[1].ToString();
        //    Session["api"] = user_id;
        //    Session["senderid"] = SenderID;
        //}
        string mobilenos = string.Empty;

        string strmsg = " Your Son/Daughter Mr/Miss." + outin + " Entered  from College on " + date + " at " + time;


        accessNew();
        if (sms_mom == "1")
        {
            string momnum = d2.GetFunction("select parentM_Mobile from applyn where app_no='" + appno + "'");
            mobilenos = momnum;
            // mobilenos = "9585698019";
            // mobilenos = "9751471583";
            if (mobilenos != "")//barath21.04.17
            {
                int m = d2.send_sms(user_id, clgcode, usercode, mobilenos, strmsg, "0");
                //barath 20.04.17
                //string strpath = "http://dnd.airsmsmarketing.info/api/sendmsg.php?user="******"&pass="******"&sender=" + SenderID + "&phone=" + mobilenos + "&text=" + strmsg + "&priority=ndnd&stype=normal";
                //smsreport(strpath, isst);
            }
        }
        if (sms_dad == "2")
        {
            string fathernum = d2.GetFunction("select parentF_Mobile from applyn where app_no='" + appno + "'");
            mobilenos = fathernum;
            // mobilenos = "9585698019";
            //  mobilenos = "9751471583";
            if (mobilenos != "")//barath21.04.17
            {
                int m = d2.send_sms(user_id, clgcode, usercode, mobilenos, strmsg, "0");

                //barath 20.04.17
                //string strpath = "http://dnd.airsmsmarketing.info/api/sendmsg.php?user="******"&pass="******"&sender=" + SenderID + "&phone=" + mobilenos + "&text=" + strmsg + "&priority=ndnd&stype=normal";
                //smsreport(strpath, isst);
            }
        }
        if (sms_stud == "3")
        {
            string studnum = d2.GetFunction("select Student_Mobile from applyn where app_no='" + appno + "'");
            mobilenos = studnum;
            // mobilenos = "9585698019";
            //   mobilenos = "9751471583";
            if (mobilenos != "")                                                         //barath21.04.17
            {
                int m = d2.send_sms(user_id, clgcode, usercode, mobilenos, strmsg, "0"); //barath 20.04.17
                //string strpath = "http://dnd.airsmsmarketing.info/api/sendmsg.php?user="******"&pass="******"&sender=" + SenderID + "&phone=" + mobilenos + "&text=" + strmsg + "&priority=ndnd&stype=normal";
                //smsreport(strpath, isst);
            }
        }
    }
Esempio n. 24
0
    protected void txt_noofstars_textchange(object sender, EventArgs e)
    {
        try
        {
            string returnValue = "1";

            DAccess2 dd        = new DAccess2();
            string   user_name = txt_noofstars.Text;
            lbl_noofstars_limit.Text = "";
            //string college = "";
            //for (int row = 0; row < Cbl_college.Items.Count; row++)
            //{
            //    if (Cbl_college.Items[row].Selected == true)
            //    {
            //        if (college == "")
            //        {
            //            college = Cbl_college.Items[row].Value;
            //        }
            //        else
            //        {
            //            college = college + "','" + Cbl_college.Items[row].Value;
            //        }
            //    }
            //}
            //clgcode1 = college;

            if (Convert.ToInt32(txt_noofstars.Text) <= 5)
            {
                if (user_name.Trim() != "" && user_name != null)
                {
                    string query = dd.GetFunction("select distinct No_Of_Stars from CO_MarkMaster  where CollegeCode in('" + clgcode1 + "') and No_Of_Stars ='" + user_name + "'");
                    if (query.Trim() == "" || query == null || query == "0" || query == "-1")
                    {
                        returnValue = "0";
                    }
                }
                else
                {
                    returnValue = "2";
                }


                switch (returnValue)
                {
                case "0":
                    lbl_noofstars_limit.Text      = "Star value Does Not Exist";
                    lbl_noofstars_limit.ForeColor = Color.Green;

                    break;

                case "1":
                    lbl_noofstars_limit.Text      = "Star value Available";
                    lbl_noofstars_limit.ForeColor = Color.Red;
                    txt_noofstars.Text            = "";
                    break;

                case "2":
                    lbl_noofstars_limit.Text      = "Please Enter Star value";
                    lbl_noofstars_limit.ForeColor = Color.Red;
                    txt_noofstars.Text            = "";
                    break;

                case "error":
                    lbl_noofstars_limit.Text      = "Error Occurred";
                    lbl_noofstars_limit.ForeColor = Color.Red;
                    txt_noofstars.Text            = "";
                    break;
                }
            }
            else
            {
                //lbl_noofstars_limit.Visible = true;
                lbl_noofstars_limit.Text      = "Enter the Maximum value of 5";
                lbl_noofstars_limit.ForeColor = Color.Red;
                txt_noofstars.Text            = "";
            }
        }
        catch (Exception ex)
        {
            d2.sendErrorMail(ex, collegecode1, "Options_Creation");
        }
    }
Esempio n. 25
0
 public static void accessNew()
 {
     try
     {
         DAccess2 dnew    = new DAccess2();
         DataSet  dsms    = new DataSet();
         string   query   = "";
         string   Master1 = "";
         string   stud    = "";
         string   values  = "";
         string   sms     = "";
         string   sms1    = "";
         string   sms2    = "";
         sms_mom  = "";
         sms_dad  = "";
         sms_stud = "";
         if (group_user.Trim() != "" && group_user.Trim() != "0")
         {
             Master1 = group_user;
             query   = "select * from Master_Settings where settings ='SMS Mobile Rights' and Group_code ='" + Master1 + "'";
         }
         else if (usercode.Trim() != "")
         {
             Master1 = usercode;
             query   = "select * from Master_Settings where settings ='SMS Mobile Rights' and usercode ='" + Master1 + "'";
         }
         dsms = dnew.select_method_wo_parameter(query, "Text");
         if (dsms.Tables[0].Rows.Count > 0)
         {
             for (int i = 0; i < dsms.Tables[0].Rows.Count; i++)
             {
                 string   val   = Convert.ToString(dsms.Tables[0].Rows[i]["value"]);
                 string[] split = val.Split(',');
                 if (split.Length == 1)
                 {
                     sms = split[0];
                     if (sms == "1")
                     {
                         sms_mom = sms;
                     }
                     else if (sms == "2")
                     {
                         sms_dad = sms;
                     }
                     else if (sms == "3")
                     {
                         sms_stud = sms;
                     }
                 }
                 else if (split.Length == 2)
                 {
                     sms  = split[0];
                     sms1 = split[1];
                     if (sms == "1")
                     {
                         sms_mom = sms;
                     }
                     else if (sms == "2")
                     {
                         sms_dad = sms;
                     }
                     else if (sms == "3")
                     {
                         sms_stud = sms;
                     }
                     if (sms1 == "1")
                     {
                         sms_mom = sms1;
                     }
                     else if (sms1 == "2")
                     {
                         sms_dad = sms1;
                     }
                     else if (sms1 == "3")
                     {
                         sms_stud = sms1;
                     }
                 }
                 else
                 {
                     sms      = split[0];
                     sms1     = split[1];
                     sms2     = split[2];
                     sms_mom  = "1";
                     sms_dad  = "2";
                     sms_stud = "3";
                 }
             }
         }
     }
     catch
     {
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            //****************************************************//
            if (Session["collegecode"] == null)
            {
                Response.Redirect("~/Default.aspx");
            }

            if (!Request.FilePath.Contains("CoeHome"))
            {
                string strPreviousPage = "";
                if (Request.UrlReferrer != null)
                {
                    strPreviousPage = Request.UrlReferrer.Segments[Request.UrlReferrer.Segments.Length - 1];
                }
                if (strPreviousPage == "")
                {
                    Response.Redirect("~/CoeMod/CoeHome.aspx");
                    return;
                }
            }
            //****************************************************//
            if (!IsPostBack)
            {
                Master1 = "select * from Master_Settings where usercode=" + Session["usercode"] + "";
                setcon.Close();
                setcon.Open();
                SqlDataReader mtrdr;

                Session["Rollflag"] = "0";
                Session["Regflag"]  = "0";
                Session["Studflag"] = "0";
                SqlCommand mtcmd = new SqlCommand(Master1, setcon);
                mtrdr = mtcmd.ExecuteReader();
                {
                    if (mtrdr.HasRows)
                    {
                        while (mtrdr.Read())
                        {
                            if (mtrdr["settings"].ToString() == "Roll No" && mtrdr["value"].ToString() == "1")
                            {
                                Session["Rollflag"] = "1";
                            }
                            if (mtrdr["settings"].ToString() == "Register No" && mtrdr["value"].ToString() == "1")
                            {
                                Session["Regflag"] = "1";
                            }
                        }
                    }
                }
                DAccess2 da = new DAccess2();
                DataSet  ds = new DataSet();
                ds = da.select_method_wo_parameter("bind_batch", "sp");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ddlBatch.Items.Clear();
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        ddlBatch.Items.Add(ds.Tables[0].Rows[i]["batch_year"].ToString());
                    }
                }

                binddegree();

                bindbranch();

                bindSem();
                bindsections();

                ddlSubjectType.Items.Insert(0, new ListItem("All", "0"));
                ddlSubjectType.Items.Insert(1, new ListItem("Regular", "1"));
                ddlSubjectType.Items.Insert(2, new ListItem("Arear", "2"));


                ddlSession.Items.Insert(0, new ListItem("F.N", "0"));
                ddlSession.Items.Insert(1, new ListItem("A.N", "1"));

                Fpstudents.Sheets[0].RowCount    = 1;
                Fpstudents.Sheets[0].ColumnCount = 6;
            }
            Fpstudents.Sheets[0].Columns[0].Width              = 60;
            Fpstudents.Sheets[0].Columns[1].Width              = 100;
            Fpstudents.Sheets[0].Columns[2].Width              = 150;
            Fpstudents.Sheets[0].Columns[3].Width              = 250;
            Fpstudents.Sheets[0].Columns[4].Width              = 50;
            Fpstudents.Sheets[0].Columns[5].Width              = 50;
            Fpstudents.Sheets[0].Columns[0].Locked             = true;
            Fpstudents.Sheets[0].Columns[1].Locked             = true;
            Fpstudents.Sheets[0].Columns[2].Locked             = true;
            Fpstudents.Sheets[0].Columns[3].Locked             = true;
            Fpstudents.Sheets[0].Columns[4].HorizontalAlign    = HorizontalAlign.Center;
            Fpstudents.Sheets[0].Columns[5].HorizontalAlign    = HorizontalAlign.Center;
            Fpstudents.Sheets[0].Columns[3].CellType           = cb;
            Fpstudents.Sheets[0].RowHeader.Visible             = false;
            Fpstudents.Sheets[0].ColumnHeader.Cells[0, 0].Text = "S.No";
            Fpstudents.Sheets[0].ColumnHeader.Cells[0, 1].Text = "Roll.No";
            Fpstudents.Sheets[0].ColumnHeader.Cells[0, 2].Text = "Reg.No";
            Fpstudents.Sheets[0].ColumnHeader.Cells[0, 3].Text = "Name";
            Fpstudents.Sheets[0].ColumnHeader.Cells[0, 4].Text = "Batch";
            Fpstudents.Sheets[0].ColumnHeader.Cells[0, 5].Text = "Select";
            FarPoint.Web.Spread.CheckBoxCellType chkcell = new FarPoint.Web.Spread.CheckBoxCellType();
            Fpstudents.Sheets[0].Columns[5].CellType = chkcell;
            Fpstudents.Sheets[0].ColumnHeader.DefaultStyle.Font.Size = FontUnit.Medium;
            Fpstudents.Sheets[0].ColumnHeader.DefaultStyle.Font.Name = "Book Antiqua";
            Fpstudents.Sheets[0].ColumnHeader.DefaultStyle.Font.Bold = true;
            Fpstudents.Sheets[0].DefaultStyle.Font.Size = FontUnit.Medium;
            Fpstudents.Sheets[0].DefaultStyle.Font.Name = "Book Antiqua";
            Fpstudents.Sheets[0].DefaultStyle.Font.Bold = false;
            Fpstudents.CommandBar.Visible = false;
            //Fpstudents.RowHeader.Visible = false;
        }
        catch (Exception ex)
        {
        }
    }
    protected void btnGo_Click(object sender, EventArgs e)
    {
        lblerror.Visible   = false;
        Fpstudents.Visible = false;

        string batch         = ddlBatch.SelectedValue.ToString();
        string degree_code   = ddlBranch.SelectedValue.ToString();
        string sem           = ddlSem.SelectedValue;
        string subjectno     = ddlSubject.SelectedValue.ToString();
        string examdate      = "";
        string examcode      = "";
        string examdate1     = txtExamDate.Text;
        string datechangenew = "";
        string datechange    = "";

        if (txtExamDate.Text != "")
        {
            string[] splitdate = examdate1.Split(new Char[] { '/' });
            string   reqdate   = splitdate[0].ToString();
            string   reqmonth  = splitdate[1].ToString();
            string   reqyear   = splitdate[2].ToString();
            datechange    = reqmonth + "-" + reqdate + "-" + reqyear;
            datechangenew = reqdate + "-" + reqmonth + "-" + reqyear;
        }
        if (batch != "" && degree_code != "" && sem != "" && subjectno != "")
        {
            string         examdatequery   = "select convert(varchar(10),exam_date,105) as exam_date,ex.exam_code from exmtt ex,exmtt_det ed where ex.exam_code=ed.exam_code and ex.degree_code=" + degree_code + " and ex.batchto=" + batch + " and ex.semester=" + sem + " and ed.subject_no=" + subjectno + "";
            SqlDataAdapter daexamdatequery = new SqlDataAdapter(examdatequery, con5);
            DataSet        dsexamdatequery = new DataSet();
            con5.Close();
            con5.Open();
            daexamdatequery.Fill(dsexamdatequery);

            if (dsexamdatequery.Tables[0].Rows.Count > 0)
            {
                examdate = Convert.ToString(dsexamdatequery.Tables[0].Rows[0]["exam_date"]);
                examcode = Convert.ToString(dsexamdatequery.Tables[0].Rows[0]["exam_code"]);
            }
            if (examdate != "")
            {
                if (txBatch.Text != "")
                {
                    if (txtExamDate.Text != "")
                    {
                        Connection();
                        int n = Convert.ToInt16(txBatch.Text.ToString());
                        name = new string[n + 1];
                        int mm = 0;
                        for (int j = 1; j <= n; j++)
                        {
                            name[j] = ("B" + j);
                            name[0] = " ";
                        }
                        string[] strcomo = new string[] { " " };
                        cb = new FarPoint.Web.Spread.ComboBoxCellType(name);
                        cb.AutoPostBack = true;

                        Hashtable ht = new Hashtable();
                        ht.Clear();
                        DAccess2 da = new DAccess2();
                        DataSet  ds = new DataSet();
                        if (ddlSem.SelectedValue.ToString() != "" && ddlBranch.SelectedValue.ToString() != "" && ddlSection.SelectedItem.Text.ToString() != "" && ddlBatch.SelectedItem.Text.ToString() != "" && ddlSubject.SelectedValue.ToString() != "")
                        {
                            ht.Add("Semester", ddlSem.SelectedItem.Text.ToString());
                            ht.Add("CollegeCode", Session["collegecode"].ToString());
                            ht.Add("DegreeCode", ddlBranch.SelectedValue.ToString());
                            ht.Add("Sections", ddlSection.SelectedItem.Text.ToString());
                            ht.Add("BatchYear", ddlBatch.SelectedItem.Text.ToString());
                            ht.Add("SubjectNo", ddlSubject.SelectedValue.ToString());
                            ds = da.select_method("ProcBatchAllocationRegNoDetails", ht, "sp");
                            Fpstudents.Sheets[0].RowCount = 0;
                            Fpstudents.Sheets[0].RowCount = ds.Tables[0].Rows.Count + 1;
                            Fpstudents.Sheets[0].PageSize = ds.Tables[0].Rows.Count + 1 * 20;
                            Fpstudents.Sheets[0].SpanModel.Add(0, 0, 1, 5);
                            FarPoint.Web.Spread.CheckBoxCellType chkcell1 = new FarPoint.Web.Spread.CheckBoxCellType();
                            Fpstudents.Sheets[0].Cells[0, 5].CellType        = chkcell1;
                            Fpstudents.Sheets[0].Cells[0, 5].HorizontalAlign = HorizontalAlign.Center;
                            Fpstudents.Sheets[0].FrozenRowCount = 1;
                            chkcell1.AutoPostBack = true;
                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                btnsave.Visible    = true;
                                Fpstudents.Visible = true;
                                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                                {
                                    string batch1 = "";

                                    if (txtExamDate.Text != "")
                                    {
                                        string         selectbatch   = "select batch from batch_allocation_practical where batch_year=" + ddlBatch.SelectedItem.Text.ToString() + " and degree_code=" + ddlBranch.SelectedValue.ToString() + " and semester=" + ddlSem.SelectedValue.ToString() + " and exam_code=" + examcode + " and subject_no=" + ddlSubject.SelectedValue.ToString() + " and roll_no='" + ds.Tables[0].Rows[i]["RollNo"].ToString() + "' and subject_no=" + subjectno + "";
                                        SqlDataAdapter daselectbatch = new SqlDataAdapter(selectbatch, con5);
                                        DataSet        dsselectbatch = new DataSet();
                                        con5.Close();
                                        con5.Open();
                                        daselectbatch.Fill(dsselectbatch);

                                        if (dsselectbatch.Tables[0].Rows.Count > 0)
                                        {
                                            batch1 = dsselectbatch.Tables[0].Rows[0]["batch"].ToString();
                                        }
                                    }
                                    Fpstudents.Sheets[0].Cells[i + 1, 0].Text            = Convert.ToString(i + 1);
                                    Fpstudents.Sheets[0].Cells[i + 1, 0].HorizontalAlign = HorizontalAlign.Center;
                                    Fpstudents.Sheets[0].Cells[i + 1, 1].Text            = ds.Tables[0].Rows[i]["RollNo"].ToString();
                                    Fpstudents.Sheets[0].Cells[i + 1, 1].HorizontalAlign = HorizontalAlign.Center;
                                    Fpstudents.Sheets[0].Cells[i + 1, 2].Text            = ds.Tables[0].Rows[i]["RegNo"].ToString();
                                    Fpstudents.Sheets[0].Cells[i + 1, 2].HorizontalAlign = HorizontalAlign.Center;
                                    Fpstudents.Sheets[0].Cells[i + 1, 3].Text            = ds.Tables[0].Rows[i]["StudentName"].ToString();
                                    Fpstudents.Sheets[0].Cells[i + 1, 4].CellType        = cb;
                                    Fpstudents.Sheets[0].SetText(i + 1, 4, batch1);
                                }
                            }
                            int rowcount = Fpstudents.Sheets[0].RowCount;
                            Fpstudents.Sheets[0].RowCount = rowcount;
                            Fpstudents.Height             = rowcount * 20;
                            if (Session["Rollflag"] == "0")
                            {
                                Fpstudents.Width = 560;
                                Fpstudents.Sheets[0].Columns[1].Visible = false;
                            }
                            if (Session["Regflag"] == "0")
                            {
                                Fpstudents.Width = 510;
                                Fpstudents.Sheets[0].Columns[2].Visible = false;
                                if (Session["Rollflag"] == "0")
                                {
                                    Fpstudents.Width = 410;
                                }
                            }
                        }
                    }
                    else
                    {
                        btnsave.Visible    = false;
                        Fpstudents.Visible = false;
                        lblerror.Visible   = true;
                        lblerror.Text      = "Exam Date Not Filled";
                    }
                }
                else
                {
                    btnsave.Visible    = false;
                    Fpstudents.Visible = false;
                    lblerror.Visible   = true;
                    lblerror.Text      = "No of Batches not Filled";
                    //ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "alert('No of Batches is not Filled')", true);
                }
            }
            else
            {
                btnsave.Visible    = false;
                Fpstudents.Visible = false;
                lblerror.Visible   = true;
                lblerror.Text      = "Time Table not created for this Subject";
                //ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "alert('Time Table is not created for this Subject')", true);
            }
        }
    }
Esempio n. 28
0
    public static List <string> studsmartno(string Smart_No, string j)
    {
        string        data    = string.Empty;
        List <string> details = new List <string>();

        try
        {
            if (Smart_No.Trim() != "" && Smart_No.Length >= 10)
            {
                DataSet  ds = new DataSet(); DataSet ds1 = new DataSet();
                DAccess2 DA          = new DAccess2();
                string[] passedvalue = j.Split('-');
                studentcardtype = Convert.ToString(passedvalue[4]);
                string stud_condition = ""; string staff_condition = "";
                if (studentcardtype.Trim() == "0")
                {
                    stud_condition  = " and smart_serial_no='" + Smart_No + "'";
                    staff_condition = " and Smartcard_serial_no='" + Smart_No + "'";

                    DateTime date  = new DateTime();
                    string[] split = Convert.ToString(passedvalue[3]).Split('/');
                    date = Convert.ToDateTime(split[1] + "/" + split[0] + "/" + split[2]);
                    string scheduledate     = Convert.ToString(date.ToString("dddd"));
                    string messatt_settings = "";

                    messatt_settings = DA.GetFunction("select mess_attendance_set from HostelIns_settings where Schedule_date='" + date.ToString("MM/dd/yyyy") + "' and Session_code='" + Convert.ToString(passedvalue[1]) + "' and Hostel_code='" + Convert.ToString(passedvalue[2]) + "'");
                    if (messatt_settings.Trim() == "0")
                    {
                        messatt_settings = DA.GetFunction("select mess_attendance_set from HostelIns_settings where Schedule_Day='" + scheduledate + "' and Session_code='" + Convert.ToString(passedvalue[1]) + "' and Hostel_code='" + Convert.ToString(passedvalue[2]) + "'");
                    }
                    string isstaff = "0";
                    System.Web.UI.WebControls.Image lbl_studimage = new System.Web.UI.WebControls.Image();
                    lbl_studimage.ImageUrl = "../images/dummyimg.png"; lbl_studimage.Visible = true;
                    if (messatt_settings.Length > 0)
                    {
                        string[] messatt_set = messatt_settings.Split(',');
                        string   q1          = "";
                        if (stud_condition.Trim() != "" || staff_condition.Trim() != "")
                        {
                            ds.Clear();
                            if (messatt_set.Contains("S"))
                            {
                                if (staff_condition.Trim() != "")
                                {
                                    q1      = " select sa.appl_id as app_no,s.staff_Code as roll_no,s.staff_name as Stud_Name,desig_name as batch,sa.staff_type as Stud_Type,s.college_code from staffmaster s,staff_appl_master sa where s.appl_no=sa.appl_no and settled=0 and resign =0 " + staff_condition + "";
                                    isstaff = "1";
                                    ds      = DA.select_method_wo_parameter(q1, "Text");
                                }
                                else
                                {
                                    q1 = " select r.app_no,r.college_code ,roll_no,Stud_Name,Stud_Type,r.degree_code,Branch_code,Batch_Year,Sections,((CONVERT(varchar(max), r.Batch_Year)+' - '+C.Course_Name+' - '+dt.dept_acronym+ case when sections='' then '' else ' - '+ (sections) end)) as batch from Registration r,Degree d,Department dt,course c where d.Dept_Code=dt.Dept_Code and c.Course_Id=d.Course_Id and r.degree_code=d.Degree_Code " + stud_condition + "";
                                    ds = DA.select_method_wo_parameter(q1, "Text"); isstaff = "0";
                                }
                            }
                            if (ds.Tables[0].Rows.Count == 0)
                            {
                                if (stud_condition.Trim() != "")
                                {
                                    q1 = " select r.app_no,r.college_code ,roll_no,Stud_Name,Stud_Type,r.degree_code,Branch_code,Batch_Year,Sections,((CONVERT(varchar(max), r.Batch_Year)+' - '+C.Course_Name+' - '+dt.dept_acronym+ case when sections='' then '' else ' - '+ (sections) end)) as batch from Registration r,Degree d,Department dt,course c where d.Dept_Code=dt.Dept_Code and c.Course_Id=d.Course_Id and r.degree_code=d.Degree_Code " + stud_condition + "";
                                    ds = DA.select_method_wo_parameter(q1, "Text"); isstaff = "0";
                                }
                            }
                            q1 = " select roll_no,Entry_Date,Session_Code,Hostel_Code,College_Code from HostelMess_Attendance ";
                            ds1.Clear();
                            ds1 = DA.select_method_wo_parameter(q1, "Text");

                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                string rollno = Convert.ToString(ds.Tables[0].Rows[0]["roll_no"]);
                                details.Add(rollno);
                                details.Add(Convert.ToString(ds.Tables[0].Rows[0]["Stud_Name"]));
                                details.Add(Convert.ToString(ds.Tables[0].Rows[0]["Stud_Type"]));
                                details.Add(Convert.ToString(ds.Tables[0].Rows[0]["batch"]));

                                lbl_studimage.Visible = true; string type = "";
                                if (isstaff == "1")
                                {
                                    type = "1";
                                    lbl_studimage.ImageUrl = "../Handler/staffphoto.ashx?staff_code=" + rollno;
                                }
                                else
                                {
                                    type = "0";
                                    lbl_studimage.ImageUrl = "../Handler/Handler4.ashx?rollno=" + rollno;
                                }
                                details.Add(Convert.ToString(lbl_studimage.ImageUrl));

                                string   app_no         = Convert.ToString(ds.Tables[0].Rows[0]["app_no"]);
                                string   clgcode        = Convert.ToString(ds.Tables[0].Rows[0]["college_code"]);
                                DataView alreadyregstud = new DataView();
                                ds1.Tables[0].DefaultView.RowFilter = "Entry_Date='" + DateTime.Now.ToString("MM/dd/yyyy") + "' and Session_Code='" + Convert.ToString(passedvalue[1]) + "' and Hostel_Code='" + Convert.ToString(passedvalue[2]) + "' and College_Code='" + clgcode + "' and Roll_No='" + rollno + "'  ";
                                alreadyregstud = ds1.Tables[0].DefaultView;
                                if (alreadyregstud.Count == 0)
                                {
                                    if (app_no.Trim() != "")
                                    {
                                        q1 = "";
                                        q1 = "insert into HostelMess_Attendance (roll_no,entry_date,Entry_time,session_name,session_code, is_staff, Hostel_code,college_code,app_no)values('" + rollno + "','" + DateTime.Now.ToString("MM/dd/yyyy") + "','" + DateTime.Now.ToString("h:mm:ss tt") + "','" + Convert.ToString(passedvalue[0]) + "','" + Convert.ToString(passedvalue[1]) + "','" + isstaff + "','" + Convert.ToString(passedvalue[2]) + "','" + clgcode + "','" + app_no + "')";
                                        int up = DA.update_method_wo_parameter(q1, "text");
                                        if (up != 0)
                                        {
                                            details.Add("1");
                                            details.Add(type);
                                        }
                                    }
                                }
                                else
                                {
                                    details.Clear();
                                    details.Add("");
                                    details.Add("");
                                    details.Add("");
                                    details.Add(""); lbl_studimage.ImageUrl = "../images/dummyimg.png";
                                    details.Add(Convert.ToString(lbl_studimage.ImageUrl));
                                    details.Add("2");
                                    details.Add("");
                                }
                            }
                            else
                            {
                                details.Clear();
                                details.Add("");
                                details.Add("");
                                details.Add("");
                                details.Add("");
                                details.Add(Convert.ToString(lbl_studimage.ImageUrl));
                                details.Add("0"); details.Add("");
                            }
                        }
                        else
                        {
                            details.Clear();
                            details.Add("");
                            details.Add("");
                            details.Add("");
                            details.Add("");
                            details.Add(Convert.ToString(lbl_studimage.ImageUrl));
                            details.Add("0"); details.Add("");
                        }
                    }
                }
            }
            return(details);
        }
        catch
        {
            details.Clear();
            details.Add("");
            details.Add("");
            details.Add("");
            details.Add(""); details.Add("");
            details.Add("0");
            return(details);
        }
    }
    public void bindSem()
    {
        Connection();
        DAccess2 das = new DAccess2();
        DataSet  dss = new DataSet();

        ddlSem.Items.Clear();
        string  duration   = "";
        Boolean first_year = false;

        ht.Clear();

        ht.Add("degree_code", ddlBranch.SelectedValue.ToString());
        ht.Add("batch_year", ddlBatch.SelectedItem.Text.ToString());
        ht.Add("college_code", Session["collegecode"].ToString());

        dss = das.select_method("bind_sem", ht, "sp");
        int count3 = dss.Tables[0].Rows.Count;

        if (count3 > 0)
        {
            ddlSem.Enabled = true;
            duration       = dss.Tables[0].Rows[0][0].ToString();
            first_year     = Convert.ToBoolean(dss.Tables[0].Rows[0][1].ToString());
            for (int loop_val = 1; loop_val <= Convert.ToInt16(duration); loop_val++)
            {
                if (first_year == false)
                {
                    ddlSem.Items.Add(loop_val.ToString());
                }
                else if (first_year == true && loop_val != 2)
                {
                    ddlSem.Items.Add(loop_val.ToString());
                }
            }
        }
        else
        {
            count3 = dss.Tables[1].Rows.Count;
            if (count3 > 0)
            {
                ddlSem.Enabled = true;
                duration       = dss.Tables[1].Rows[0][0].ToString();
                first_year     = Convert.ToBoolean(dss.Tables[1].Rows[0][1].ToString());
                for (int loop_val = 1; loop_val <= Convert.ToInt16(duration); loop_val++)
                {
                    if (first_year == false)
                    {
                        ddlSem.Items.Add(loop_val.ToString());
                    }
                    else if (first_year == true && loop_val != 2)
                    {
                        ddlSem.Items.Add(loop_val.ToString());
                    }
                }
            }
            else
            {
                ddlSem.Enabled = false;
            }
        }
    }