예제 #1
0
파일: ServiceType.cs 프로젝트: xyecom/AMS
        /// <summary>
        /// ��ȡָ����ŵķ���������
        /// </summary>
        /// <param name="ctid">Ҫ��ȡ�ķ���������ı��</param>
        /// <returns>�ñ���µķ���������</returns>
        public ServiceTypeInfo GetItem(Int64 stid)
        {
            ServiceTypeInfo sti = null;

            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@strWhere"," where ST_ID ="+stid.ToString()),
                new SqlParameter("@strTableName","i_ServiceType"),
                new SqlParameter("@strOrder","")
            };

            using (SqlDataReader dr = XYECOM.Core.Data.SqlHelper.ExecuteReader(CommandType.StoredProcedure, "XYP_SelectByWhere", param))
            {
                if (dr.Read())
                    sti = new ServiceTypeInfo(
                        Convert.ToInt64(dr["ST_ID"]),
                        dr["ST_Name"].ToString(),
                        Convert.ToInt64(dr["ST_ParentID"]),
                        dr["ModuleName"].ToString(),
                        dr["FullId"].ToString(),
                        Core.MyConvert.GetInt32(dr["InfoCount"].ToString())
                        );
            }

            return sti;
        }
예제 #2
0
        /// <summary>
        /// ����ָ���ķ�����Ϣ������
        /// </summary>
        /// <param name="ct">Ҫ���ĵķ�����Ϣ������</param>
        /// <returns>����,���ڻ����0��ɹ�,�����ʧ��</returns>
        public int Update(ServiceTypeInfo st)
        {
            if (object.Equals(null, st))
                return -2;

            return DAL.Update(st);
        }
예제 #3
0
        /// <summary>
        /// ���һ���µķ�����Ϣ������
        /// </summary>
        /// <param name="ct">Ҫ��ӵķ�����Ϣ������</param>
        /// <returns>����,���ڻ����0��ɹ�,�����ʧ��,-1��������ͬ���</returns>
        public int Insert(ServiceTypeInfo st)
        {
            if (object.Equals(null, st))
                return -2;

            return DAL.Insert(st);
        }
예제 #4
0
파일: ServiceType.cs 프로젝트: xyecom/AMS
        /// <summary>
        /// ����ָ���ķ�����Ϣ������
        /// </summary>
        /// <param name="ct">Ҫ���ĵķ�����Ϣ������</param>
        /// <returns>����,���ڻ����0��ɹ�,�����ʧ��</returns>
        public int Update(ServiceTypeInfo info)
        {
            string fullId = Core.Utils.AppendComma(GetFullID(info.ST_ParentID));

            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@ST_ID",info.ST_ID),
                new SqlParameter("@ST_Name",info.ST_Name),
                new SqlParameter("@ModuleName",info.ModuleName),
                new SqlParameter("@ST_ParentID",info.ST_ParentID),
                new SqlParameter("@FullId",fullId),
            };

            return XYECOM.Core.Data.SqlHelper.ExecuteNonQuery(CommandType.StoredProcedure, "XYP_UpdateServiceType", param);
        }
예제 #5
0
파일: TypeAdd.aspx.cs 프로젝트: xyecom/AMS
    protected void btnok_Click(object sender, EventArgs e)
    {
        PT_ID = XYECOM.Core.MyConvert.GetInt64(XYECOM.Core.XYRequest.GetQueryString("pt_id"));
        ename = XYECOM.Core.XYRequest.GetQueryString("ename");

        if (this.tbName.Text == "")
        {
            Alert("�������Ʋ���Ϊ�գ�");
            return;
        }
        type = XYECOM.Core.XYRequest.GetQueryString("type");

        //�ж�����ӱ��滹�DZ༭����
        if (type.Equals("0") || XYECOM.Core.XYRequest.GetQueryString("pt_id").Equals("0"))
        {

            string TypeName = tbName.Text.Trim().Replace("��", ",");

            string[] arr = TypeName.Split(',');

            for (int i = 0; i < arr.Length; i++)
            {
                InsertData(arr[i].Trim());

                if (error) continue;
            }

            if (!error)
                Response.Redirect("Typelist.aspx?ename=" + ename + "&orderid=" + PT_ID + "&add=1");
        }

        if (type.Equals("1"))
        {
            int err = 0;

            if (ename.Equals("job") || ename.Equals("exhibition"))
            {
                if (ename.Equals("job"))
                {
                    postinfo = post.GetItem((int)PT_ID);
                    postinfo.P_Name = this.tbName.Text.Trim();

                    err = post.Update(postinfo);
                }
                if (ename.Equals("exhibition"))
                {
                    showinfo = showtype.GetItem(PT_ID);
                    showinfo.SHT_Name = this.tbName.Text.Trim();

                    err = showtype.Update(showinfo);
                }
            }
            else
            {
                if (ename.Equals("investment") || XYECOM.Configuration.Module.Instance.GetItem(ename).PEName.Equals("investment"))
                {
                    iti = it.GetItem(PT_ID);
                    iti.IT_Name = this.tbName.Text.Trim();

                    err = it.Update(iti);
                }
                if (ename.Equals("service") || XYECOM.Configuration.Module.Instance.GetItem(ename).PEName.Equals("service"))
                {
                    sti = st.GetItem(PT_ID);
                    sti.ST_Name = this.tbName.Text.Trim();

                    err = st.Update(sti);
                }
            }
            if (err > 0)
            {
                Response.Redirect("Typelist.aspx?ename=" + ename + "&orderid=" + PT_ID);
            }
            else
            {
                Alert("�޸�ʧ�ܣ�", backUrl + "?orderid=" + pt_id + "&ename=" + XYECOM.Core.XYRequest.GetQueryString("ename"));
            }
        }
    }
예제 #6
0
파일: TypeAdd.aspx.cs 프로젝트: xyecom/AMS
    private void pageinit()
    {
        if (XYECOM.Core.XYRequest.GetQueryString("pt_id").Equals("0"))
        {
            lblName.Text = "�����";
            this.module.Visible = true;
            this.module2.Visible = true;
        }
        //ģ������
        ename = XYECOM.Core.XYRequest.GetQueryString("ename");

        switch (ename)
        {
            case "venture":
                lblType.Text = "�ӹ���Ϣ";
                break;
            case "investment":
                lblType.Text = "���̴���";
                break;
            case "service":
                lblType.Text = "������Ϣ";
                break;
            case "brand":
                lblType.Text = "Ʒ�Ʒ���";
                break;
            case "job":
                lblType.Text = "��Ƹ��λ";
                break;
            case "exhibition":
                lblType.Text = "չ�����";
                break;
            case "pifa":
                lblType.Text = "������Ϣ";
                break;
        }

        //type:0��� / type:1�༭
        type = XYECOM.Core.XYRequest.GetQueryString("type");

        if (ename.Equals(""))
        {
            ename = "venture";
        }

        pt_id = XYECOM.Core.XYRequest.GetQueryString("pt_id");

        int parentId = XYECOM.Core.MyConvert.GetInt32(pt_id);

        #region �����������
        if (type.Equals("0"))
        {
            if (ename.Equals("job") || ename.Equals("exhibition"))
            {
                if (ename.Equals("job") && pt_id != "0")
                {
                    postinfo = post.GetItem(parentId);
                    lblName.Text = GetTypeAllName(ename, postinfo.P_ID);
                }
                if ((ename.Equals("exhibition") && pt_id != "0"))
                {
                    showinfo = showtype.GetItem(parentId);
                    lblName.Text = GetTypeAllName(ename, showinfo.SHT_ID);
                }
            }
            else
            {
                if ((ename.Equals("investment") || XYECOM.Configuration.Module.Instance.GetItem(ename).PEName.Equals("investment")) && pt_id != "0")
                {
                    iti = it.GetItem(parentId);
                    lblName.Text = GetTypeAllName(ename, iti.IT_ID);
                }
                if ((ename.Equals("service") || XYECOM.Configuration.Module.Instance.GetItem(ename).PEName.Equals("service")) && pt_id != "0")
                {
                    sti = st.GetItem(parentId);
                    lblName.Text = GetTypeAllName(ename, sti.ST_ID);
                }
            }
        }
        #endregion

        #region ���ر༭���
        if (type.Equals("1"))
        {

            lbremark.Visible = false;
            tbName.TextMode = TextBoxMode.SingleLine;

            if (ename.Equals("job") || ename.Equals("exhibition"))
            {
                if (ename.Equals("job") && pt_id != "0")
                {
                    postinfo = post.GetItem(Convert.ToInt32(pt_id));
                    PT_ID = postinfo.P_ID;
                    this.tbName.Text = postinfo.P_Name;
                    this.PT_ParentID = postinfo.P_ParentID;
                    if (PT_ParentID != 0)
                    {
                        postinfo = post.GetItem(Convert.ToInt32(PT_ParentID));
                        lblName.Text = GetTypeAllName(ename, postinfo.P_ID);
                    }
                    else
                    {
                        this.lblName.Text = "һ�����";
                    }
                }
                if ((ename.Equals("exhibition") && pt_id != "0"))
                {
                    showinfo = showtype.GetItem(Convert.ToInt64(pt_id));
                    PT_ID = showinfo.SHT_ID;
                    this.tbName.Text = showinfo.SHT_Name;
                    this.PT_ParentID = showinfo.SHT_ParentID;
                    if (PT_ParentID != 0)
                    {
                        showinfo = showtype.GetItem(PT_ParentID);
                        lblName.Text = GetTypeAllName(ename, showinfo.SHT_ID);
                    }
                    else
                    {
                        this.lblName.Text = "һ�����";
                    }
                }
            }
            else
            {
                if ((ename.Equals("investment") || XYECOM.Configuration.Module.Instance.GetItem(ename).PEName.Equals("investment")) && pt_id != "0")
                {
                    iti = it.GetItem(Convert.ToInt64(pt_id));
                    PT_ID = iti.IT_ID;
                    this.tbName.Text = iti.IT_Name;
                    this.PT_ParentID = iti.IT_ParentID;
                    if (PT_ParentID != 0)
                    {
                        iti = it.GetItem(PT_ParentID);
                        lblName.Text = GetTypeAllName(ename, iti.IT_ID);
                    }
                    else
                    {
                        this.lblName.Text = "һ�����";
                    }
                }
                if ((ename.Equals("service") || XYECOM.Configuration.Module.Instance.GetItem(ename).PEName.Equals("service")) && pt_id != "0")
                {
                    sti = st.GetItem(Convert.ToInt64(pt_id));
                    PT_ID = sti.ST_ID;
                    this.tbName.Text = sti.ST_Name;
                    this.PT_ParentID = sti.ST_ParentID;
                    if (PT_ParentID != 0)
                    {
                        sti = st.GetItem(PT_ParentID);
                        lblName.Text = GetTypeAllName(ename, sti.ST_ID);
                    }
                    else
                    {
                        this.lblName.Text = "һ�����";
                    }
                }
            }
        }
        #endregion
    }