Exemple #1
0
        public wctProjectInfo Converting(DataRow drwctProject)
        {
            wctProjectInfo result = null;

            try
            {
                result = new wctProjectInfo();
                if (drwctProject["ID"] != DBNull.Value)
                {
                    result.ID = Convert.ToInt32(drwctProject["ID"]);
                }
                if (drwctProject["XCode"] != DBNull.Value)
                {
                    result.XCode = Convert.ToString(drwctProject["XCode"]);
                }
                if (drwctProject["ProjectName"] != DBNull.Value)
                {
                    result.ProjectName = Convert.ToString(drwctProject["ProjectName"]);
                }
                if (drwctProject["Description"] != DBNull.Value)
                {
                    result.Description = Convert.ToString(drwctProject["Description"]);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
 public int Insert(wctProjectInfo mywctProject)
 {
     int result = 0;
     try
     {
         ArrayList param = new ArrayList();
         param.Add(new SqlParameter("@XCode", mywctProject.XCode));
         param.Add(new SqlParameter("@ProjectName", mywctProject.ProjectName));
         param.Add(new SqlParameter("@Description", mywctProject.Description));
         result = DataFactory.Execute(INSERT_WCTPROJECT, param);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return result;
 }
Exemple #3
0
        public int Insert(wctProjectInfo mywctProject)
        {
            int result = 0;

            try
            {
                ArrayList param = new ArrayList();
                param.Add(new SqlParameter("@XCode", mywctProject.XCode));
                param.Add(new SqlParameter("@ProjectName", mywctProject.ProjectName));
                param.Add(new SqlParameter("@Description", mywctProject.Description));
                result = DataFactory.Execute(INSERT_WCTPROJECT, param);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
Exemple #4
0
        public wctProjectInfo Load(int ID)
        {
            wctProjectInfo result = null;

            try
            {
                ArrayList param = new ArrayList();
                param.Add(new SqlParameter("@ID", ID));
                DataTable dt = DataFactory.SelectTable(LOAD_WCTPROJECT, param);
                if (dt.Rows.Count > 0)
                {
                    result = Converting(dt.Rows[0]);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
 public wctProjectInfo Converting(DataRow drwctProject)
 {
     wctProjectInfo result = null;
     try
     {
         result = new wctProjectInfo();
         if (drwctProject["ID"] != DBNull.Value)
             result.ID = Convert.ToInt32(drwctProject["ID"]);
         if (drwctProject["XCode"] != DBNull.Value)
             result.XCode = Convert.ToString(drwctProject["XCode"]);
         if (drwctProject["ProjectName"] != DBNull.Value)
             result.ProjectName = Convert.ToString(drwctProject["ProjectName"]);
         if (drwctProject["Description"] != DBNull.Value)
             result.Description = Convert.ToString(drwctProject["Description"]);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return result;
 }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            wctProjectInfo inf = new wctProjectInfo();
            inf.Description = txtDescription.Text.Trim();
            inf.ProjectName = txtProjectName.Text.Trim();
            inf.XCode = txtXCode.Text.Trim();

            wctProjectController db = new wctProjectController();
            if (Request.QueryString["id"] == null)
            {
                db.Insert(inf);
            }
            else
            {
                inf.ID = Convert.ToInt32(Request.QueryString["id"]);
                db.Update(inf);
            }

            string return_url = Utils.LinkUrl(this.TabId, this.ModuleId, "project");
            Response.Redirect(return_url);
        }