Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable dt_User = obj.GetData(@"SELECT        HRMIS_tblEmployeeInformation.EmployeeID, HRMIS_tblEmployeeInformation.FullName, aspnet_Users.UserId, aspnet_Users.UserName
FROM            HRMIS_tblEmployeeInformation INNER JOIN
                         aspnet_Users ON HRMIS_tblEmployeeInformation.EmployeeID = aspnet_Users.Registration_Number where LoweredUserName=N'" + User.Identity.Name + "'");
                hdUser.Value = dt_User.Rows[0]["UserId"].ToString();
                FillGrid();
            }
        }
        public static List <BootstrapTreeNode> GetChilds(int nodeid)
        {
            clsDbGeneral             db       = new clsDbGeneral();
            DataTable                dt       = db.GetData("SELECT   Department_Code, Department_Name, Parent_Department_Code FROM   HRMIS_tblDepartment where Parent_Department_Code=" + nodeid);
            List <BootstrapTreeNode> toreturn = new List <BootstrapTreeNode>();

            foreach (DataRow row in dt.Rows)
            {
                BootstrapTreeNode nd = new BootstrapTreeNode();
                nd.text = row["Department_Name"].ToString();
                if (HaveChildNodes((int)row["Department_Code"]))
                {
                    nd.nodes      = GetChilds((int)row["Department_Code"]);
                    nd.selectable = true;
                    nd.id         = (int)row["Department_Code"];
                }
                else
                {
                    nd.selectable = true;
                    nd.id         = (int)row["Department_Code"];
                }

                toreturn.Add(nd);
            }
            return(toreturn);
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable dt_User = obj.GetData(@"SELECT        HRMIS_tblEmployeeInformation.EmployeeID, HRMIS_tblEmployeeInformation.FullName, aspnet_Users.UserId, aspnet_Users.UserName
FROM            HRMIS_tblEmployeeInformation INNER JOIN
                         aspnet_Users ON HRMIS_tblEmployeeInformation.EmployeeID = aspnet_Users.Registration_Number where LoweredUserName=N'" + User.Identity.Name + "'");
                hdUser.Value = dt_User.Rows[0]["UserId"].ToString();

                obj.fillDll(ddlProductGroup, "GroupName", "GroupID", "SELECT  GroupID, GroupName FROM   IMIS_tblProductGroup");
                obj.fillDll(ddlProductBrand, "BrandName", "BrandID", "SELECT   BrandID, BrandName  FROM IMIS_tblBrand");
                obj.fillDll(ddlProductOrigin, "ProductOriginName", "ProductOriginID", "SELECT ProductOriginID, ProductOriginName FROM  IMIS_tblProductOrigin ");
                obj.fillDll(ddlUnit, "UnitName", "UnitID", "SELECT UnitID, UnitName FROM IMIS_tblUnitOfMeasurement");
                obj.fillDll(ddlSize, "SizeName", "SizeID", "SELECT   SizeID, SizeName, SizeShortName FROM  IMIS_tblSize");
                obj.fillDll(ddlColor, "ColorName", "ColorID", "SELECT   ColorID, ColorName, ColorShortName FROM   IMIS_tblColor");
                obj.fillDll(ddlPacking, "PackingName", "PackingID", "SELECT  PackingID, PackingName FROM   IMIS_tblProductPaking");
                obj.fillDll(ddlProductUsageType, "UsageName", "UsageID", "SELECT    UsageID, UsageName FROM  IMIS_tblProductUsageType");

                #region Data Of By Store
                //obj.fillDll(ddlProductGroup, "GroupName", "GroupID", "SELECT  GroupID, GroupName FROM   IMIS_tblProductGroup where StoreID=" + hdStoreID.Value + "");
                //obj.fillDll(ddlProductBrand, "BrandName", "BrandID", "SELECT   BrandID, BrandName  FROM IMIS_tblBrand where StoreID=" + hdStoreID.Value + "");
                //obj.fillDll(ddlProductOrigin, "ProductOriginName", "ProductOriginID", "SELECT ProductOriginID, ProductOriginName FROM  IMIS_tblProductOrigin  where StoreID=" + hdStoreID.Value + "");
                //obj.fillDll(ddlUnit, "UnitName", "UnitID", "SELECT UnitID, UnitName FROM IMIS_tblUnitOfMeasurement where StoreID=" + hdStoreID.Value + "");
                //obj.fillDll(ddlSize, "SizeName", "SizeID", "SELECT   SizeID, SizeName, SizeShortName FROM  IMIS_tblSize where StoreID=" + hdStoreID.Value + "");
                //obj.fillDll(ddlColor, "ColorName", "ColorID", "SELECT   ColorID, ColorName, ColorShortName FROM   IMIS_tblColor where StoreID=" + hdStoreID.Value + "");
                //obj.fillDll(ddlPacking, "PackingName", "PackingID", "SELECT  PackingID, PackingName FROM   IMIS_tblProductPaking where StoreID=" + hdStoreID.Value + "");
                #endregion
            }
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["EmpNo"] != null)
            {
                hdEmployeeID.Value = Session["EmpNo"].ToString();
            }

            if (!IsPostBack)
            {
                obj.fillDll(ddlPosition, "Position_Name", "Position_ID", @"SELECT  Position_ID,Position_Name_English +' - '+Position_Name_Dari as Position_Name FROM    HRMIS_tblPosition");
                obj.fillDll(ddlPresentProvince, "Province_Name", "Province_ID", "SELECT Province_ID, Province_Name FROM  Provinces");
                obj.fillDll(ddlEducationGarde, "E_Grade_Name", "E_Grade_ID", "SELECT E_Grade_ID, E_Grade_Name FROM  HRMIS_tblEducationGrade");
                DataTable dt_User = obj.GetData(@"select  UserId from aspnet_Users where LoweredUserName=N'" + User.Identity.Name + "'");
                hdUser.Value = dt_User.Rows[0]["UserId"].ToString();
            }
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                obj.fillDll(ddlPermanentProvince, "Province_Name", "Province_ID", "SELECT Province_ID, Province_Name FROM  Provinces");
                obj.fillDll(ddlPresentProvince, "Province_Name", "Province_ID", "SELECT Province_ID, Province_Name FROM  Provinces");
                obj.fillDll(ddlEducationGrade, "E_Grade_Name", "E_Grade_ID", "SELECT E_Grade_ID, E_Grade_Name FROM  HRMIS_tblEducationGrade");

                DataTable dt_User = obj.GetData(@"SELECT        HRMIS_tblEmployeeInformation.EmployeeID, HRMIS_tblEmployeeInformation.FullName, aspnet_Users.UserId, aspnet_Users.UserName
FROM            HRMIS_tblEmployeeInformation INNER JOIN
                         aspnet_Users ON HRMIS_tblEmployeeInformation.EmployeeID = aspnet_Users.Registration_Number where LoweredUserName=N'" + User.Identity.Name + "'");
                hdUser.Value = dt_User.Rows[0]["UserId"].ToString();


                //txtEmpID.Text= GetEmpID();
                //DataTable dt_User = obj.GetData(@"select  UserId from aspnet_Users where LoweredUserName=N'" + User.Identity.Name + "'");
                //hdUser.Value = dt_User.Rows[0]["UserId"].ToString();
            }
            //btnReset.Attributes.Add("onclick", "window.open('Tuition_Fee_Transaction.aspx?Fee_Month_ID=" +.Text + "',null,'width=350,height=700,top=100,left=10','true');");
        }
        public static bool HaveChildNodes(int nodeid)
        {
            clsDbGeneral db = new clsDbGeneral();

            return(db.GetData("SELECT   Department_Code, Department_Name, Parent_Department_Code FROM   HRMIS_tblDepartment where Parent_Department_Code=" + nodeid).Rows.Count > 0 ? true : false);
        }