Exemplo n.º 1
0
        public List <VM_Porject> Project_Gridlist(VM_Porject Request)
        {
            MyDatabaseClass   objdb = new MyDatabaseClass();
            bool              hasExceptionThrown = false;
            string            errorMessage       = "";
            List <VM_Porject> Fill_list          = new List <VM_Porject>();

            try
            {
                string sqlquery = "";
                if (Request.PROJECT_UID == 0)
                {
                    sqlquery = @"select * from project_mast where status='A'";
                }
                else if (Request.PROJECT_UID > 0)
                {
                    sqlquery = @"select * from project_mast where PROJECT_UID= '" + Request.PROJECT_UID + "'";
                }
                DataSet ds = objdb.GetDataSet(sqlquery, ref hasExceptionThrown, ref errorMessage);
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    VM_Porject vm = new VM_Porject();
                    vm.PROJECT_UID  = Convert.ToInt32(ds.Tables[0].Rows[i]["PROJECT_UID"].ToString());
                    vm.PROJECT_CODE = ds.Tables[0].Rows[i]["PROJECT_CODE"].ToString();
                    vm.PROJECT_NAME = ds.Tables[0].Rows[i]["PROJECT_NAME"].ToString();
                    vm.DOMAIN       = ds.Tables[0].Rows[i]["DOMAIN"].ToString();
                    vm.START_DATE   = ds.Tables[0].Rows[i]["START_DATE"].ToString();
                    vm.END_DATE     = ds.Tables[0].Rows[i]["END_DATE"].ToString();

                    string  emp_code = "";
                    DataSet dsemp    = objdb.GetDataSet("Select emp_code from project_team where project_code='" + ds.Tables[0].Rows[i]["PROJECT_CODE"].ToString() + "'", ref hasExceptionThrown, ref errorMessage);
                    for (int j = 0; j < dsemp.Tables[0].Rows.Count; j++)
                    {
                        emp_code += dsemp.Tables[0].Rows[j]["emp_code"].ToString() + ",";
                    }
                    vm.EMP_CODE = emp_code.Split(',');

                    Fill_list.Add(vm);
                }
                // return Fill_list;
            }
            catch (Exception ex)
            {
                ex.Message.ToString();
                throw;
            }
            return(Fill_list);
        }
Exemplo n.º 2
0
        public static List <VM_Porject> ProjectName()
        {
            MyDatabaseClass   objdb = new MyDatabaseClass();
            bool              hasExceptionThrown = false;
            string            errorMessage       = "";
            List <VM_Porject> Lst = new List <VM_Porject>();
            DataSet           ds  = new DataSet();

            ds = objdb.GetDataSet("Select * from project_mast where status='A'", ref hasExceptionThrown, ref errorMessage);
            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    VM_Porject vm = new VM_Porject();
                    vm.PROJECT_NAME = ds.Tables[0].Rows[i]["PROJECT_NAME"].ToString();
                    vm.PROJECT_CODE = ds.Tables[0].Rows[i]["PROJECT_CODE"].ToString();
                    Lst.Add(vm);
                }
            }
            return(Lst);
        }
Exemplo n.º 3
0
        public static List <VM_Domain> DomainList()
        {
            MyDatabaseClass  objdb = new MyDatabaseClass();
            bool             hasExceptionThrown = false;
            string           errorMessage       = "";
            List <VM_Domain> Lst = new List <VM_Domain>();
            DataSet          ds  = new DataSet();

            ds = objdb.GetDataSet("Select * from Domain_mast where status='A'", ref hasExceptionThrown, ref errorMessage);
            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    VM_Domain vm = new VM_Domain();
                    vm.DOMAIN      = ds.Tables[0].Rows[i]["DOMAIN"].ToString();
                    vm.DOMAIN_CODE = ds.Tables[0].Rows[i]["DOMAIN_CODE"].ToString();
                    Lst.Add(vm);
                }
            }
            return(Lst);
        }