示例#1
0
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            CarCategoryInfo obj = (CarCategoryInfo)e.Row.DataItem;

            HyperLink col2 = (HyperLink)e.Row.Cells[2].Controls[0];
            col2.NavigateUrl = "carCategoryEdit.aspx?carCategoryCode=" + obj.CarCategoryCode + "&mode=modify";
            col2.ImageUrl    = "~/images/icon/edit.gif";

            HyperLink col3 = (HyperLink)e.Row.Cells[3].Controls[0];
            col3.NavigateUrl = "#";
            col3.Attributes.Add("onclick", "return confirmDelete('carCategoryDelete.aspx?carCategoryCode=" + obj.CarCategoryCode + "');");
            col3.ImageUrl = "~/images/icon/delete.gif";

            for (int i = 0; i < e.Row.Cells.Count; i++)
            {
                if (i < 2)
                {
                    e.Row.Cells[i].Attributes.Add("onclick", "window.location='carCategoryView.aspx?carCategoryID=" + obj.CarCategoryCode + "';");
                    e.Row.Cells[i].Attributes.Add("style", "cursor:hand");
                }
            }
        }
    }
示例#2
0
文件: Car.cs 项目: TranTan90/hana
        /// <summary>
        /// 차종 정보 가져오기
        /// </summary>
        /// <param name="carCategoryID"></param>
        /// <returns></returns>
        public CarCategoryInfo getCarCategory(String carCategoryID)
        {
            log.Debug(@"=================START getCarCategory=================");
            log.Debug(@"carCategoryID = " + carCategoryID);

            CarCategoryInfo obj = null;

            //Create a parameter
            SqlParameter parm = new SqlParameter(PARM_CARCATEGORY_ID, SqlDbType.VarChar, 10);

            //Bind the parameter
            parm.Value = carCategoryID;

            //Execute the query
            using (SqlDataReader rdr = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, SQL_SELECT_CARCATEGORY, parm))
            {
                if (rdr.Read())
                {
                    obj = new CarCategoryInfo(rdr.GetInt16(0), rdr.GetString(1), rdr.GetDateTime(2), rdr.GetString(3));
                }
                else
                {
                    obj = new CarCategoryInfo();
                }
            }

            log.Debug(@"=================END getCarCategory=================");

            return(obj);
        }
示例#3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // 관리자 체크 check người quản lý
        EmployeeInfo loginEmployee = new EmployeeInfo();

        loginEmployee = (EmployeeInfo)Session["loginMember"];
        if (loginEmployee == null)
        {
            Response.Redirect("~/login.aspx", true);
        }

        if (loginEmployee.ISAdmin == false)
        {
            Response.Redirect("~/login.aspx", true);
        }

        if (Page.IsPostBack)
        {
            // 수정하기 Sửa
            if (mode.Value.Equals("modify"))
            {
                int result = bll.updateCarCategory(Request.QueryString["carCategoryCode"], codeName.Text, txtStatus.Text);
                Response.Redirect("carCategoryList.aspx");
            }
            // 등록하기  đăng ký
            else
            {
                int result = bll.insertCarCategory(codeName.Text, txtStatus.Text);
                Response.Redirect("carCategoryList.aspx");
            }
        }
        else
        {
            if (Request.QueryString["mode"].Equals("modify"))
            {
                CarCategoryInfo carCategory = bll.getCarCategory(Request.QueryString["carCategoryCode"]);

                codeName.Text  = carCategory.CodeName;
                txtStatus.Text = carCategory.Status;

                lableCodeName.Text = " Sửa thông tin (정보 수정하기) : " + carCategory.CodeName;
                mode.Value         = Request.QueryString["mode"];
            }
            else
            {
                lableCodeName.Text = "Đăng ký loại xe (차종 등록하기)";
                mode.Value         = Request.QueryString["mode"];
            }
        }
    }
示例#4
0
文件: Car.cs 项目: TranTan90/hana
        /// <summary>
        /// 차종 목록
        /// </summary>
        /// <param name="txtKey"></param>
        /// <returns></returns>
        public List <CarCategoryInfo> getCarCategoryList(String txtKey)
        {
            log.Debug(@"=================START getCarCategoryList=================");
            log.Debug(@"txtKey = " + txtKey);

            List <CarCategoryInfo> list = new List <CarCategoryInfo>();


            String SQL_SELECT_CAR_CATEGORY_LIST = "SELECT carCategoryCode,codeName,regDate, status ";

            SQL_SELECT_CAR_CATEGORY_LIST += "FROM CarCategory ";

            if (!String.IsNullOrEmpty(txtKey))
            {
                if (txtKey.Equals("A"))
                {
                    SQL_SELECT_CAR_CATEGORY_LIST += "WHERE status = 'Y' ";
                }
                else
                {
                    SQL_SELECT_CAR_CATEGORY_LIST += "WHERE codeName LIKE '%" + txtKey + "%' ";
                }
            }

            SQL_SELECT_CAR_CATEGORY_LIST += "ORDER BY codeName";

            using (SqlDataReader rdr = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, SQL_SELECT_CAR_CATEGORY_LIST, null))
            {
                while (rdr.Read())
                {
                    CarCategoryInfo obj = new CarCategoryInfo(rdr.GetInt16(0), rdr.GetString(1), rdr.GetDateTime(2), rdr.GetString(3));
                    list.Add(obj);
                }
            }

            log.Debug(@"=================END getCarCategoryList=================");

            return(list);
        }