Example #1
0
        /// <summary>
        /// 获取业务表配置
        /// </summary>
        public static H5Objects GetObject(int FunctionCode)
        {
            H5Objects o = new H5Objects();

            if (FunctionCode == 1)
            {
                o.HO_NAME          = "机票";
                o.HO_TABLE_NAME    = "SP_TICKET";
                o.HO_ID_FIELD      = "TK_ID";
                o.HO_USER_FIELD    = "TK_USER_ID";
                o.HO_DATE_FIELD    = "TK_CREATE_DATE";
                o.HO_STAUTS_FIELD  = "TK_STATUS";
                o.HO_MASTER_FIELD  = "TK_NUMBER";
                o.HO_BUSINESS_TYPE = 1;
            }

            if (FunctionCode == 2)
            {
                o.HO_NAME          = "采购";
                o.HO_TABLE_NAME    = "SP_BUY";
                o.HO_ID_FIELD      = "BY_ID";
                o.HO_USER_FIELD    = "BY_USER_ID";
                o.HO_DATE_FIELD    = "BY_CREATE_DATE";
                o.HO_STAUTS_FIELD  = "BY_STATUS";
                o.HO_MASTER_FIELD  = "BY_TYPE";
                o.HO_BUSINESS_TYPE = 2;
            }

            return(o);
        }
Example #2
0
        private DataTable get_form_data()
        {
            StringBuilder       strsql     = new StringBuilder();
            StringBuilder       str_column = new StringBuilder();
            StringBuilder       str_where  = new StringBuilder();
            StringBuilder       str_order  = new StringBuilder();
            List <SqlParameter> list_para  = new List <SqlParameter>();
            H5Objects           o          = H5Object;

            str_column.Append(o.HO_ID_FIELD + " as id");
            str_column.Append("," + o.HO_USER_FIELD + " as user_id");
            str_column.Append("," + o.HO_STAUTS_FIELD + " as status");

            List <H5Columns> list_column = H5Column;

            foreach (H5Columns item_column in list_column)
            {
                str_column.Append("," + item_column.HC_NAME);
            }

            str_where.Append(" and " + o.HO_ID_FIELD + "=@" + o.HO_ID_FIELD);
            list_para.Add(new SqlParameter("@" + o.HO_ID_FIELD, Key));

            strsql.Append("select " + str_column + " from " + o.HO_TABLE_NAME + " where 1=1 " + str_where);

            SqlConnection cn = comm_fun.get_cn();

            try
            {
                DataTable dt = comm_fun.GetDatatable(strsql.ToString(), cn, list_para);
                if (dt.Rows.Count > 0)
                {
                    DataRow dr     = dt.Rows[0];
                    string  status = dr["status"].ToString();

                    if (status == "0" || status == "3")
                    {
                        ApproveAble = true;
                    }

                    if (status == "0")
                    {
                        CancleAble = true;
                    }
                }
                return(dt);
            }
            catch (Exception ex)
            {
                comm_fun.WriteLog(ex.ToString());
            }
            finally
            {
                comm_fun.CloseConnection(cn);
            }
            return(new DataTable());
        }
Example #3
0
        public void RenderTitle()
        {
            H5Objects o = H5Object;

            H5Head h = new H5Head();

            h.HeadText   = o.HO_NAME;
            h.IsShowMore = true;
            Gcontainer.Controls.Add(h);
        }
Example #4
0
        private DataTable get_work_follow_data()
        {
            StringBuilder       strsql    = new StringBuilder();
            List <SqlParameter> list_para = new List <SqlParameter>();
            H5Objects           o         = H5Object;

            strsql.Append("select WF_FROM_USER,WF_TO_USER,dbo.fn_convert_datetime(WF_APPROVE_DATE) as WF_APPROVE_DATE,WF_REASON,WF_STATUS from SP_WORK_FOLLOW where WF_BUSINESS_TYPE=@WF_BUSINESS_TYPE and WF_BUSINESS_KEY=@WF_BUSINESS_KEY ORDER BY WF_CREATE_DATE DESC ");
            list_para.Add(new SqlParameter("@WF_BUSINESS_TYPE", o.HO_BUSINESS_TYPE));
            list_para.Add(new SqlParameter("@WF_BUSINESS_KEY", Key));
            SqlConnection cn = comm_fun.get_cn();

            try
            {
                DataTable dt = comm_fun.GetDatatable(strsql.ToString(), cn, list_para);
                if (dt.Rows.Count > 0)
                {
                    dt.Columns.Add("WF_TO_USER_NAME");
                    dt.Columns.Add("WF_TO_USER_IMAGE");
                    dt.Columns.Add("WF_STATUS_CLASS");
                    dt.Columns.Add("WF_STATUS_TEXT");

                    foreach (DataRow dr in dt.Rows)
                    {
                        dr["WF_TO_USER_NAME"]  = GData.get_user_name(dr["WF_TO_USER"].ToString());
                        dr["WF_TO_USER_IMAGE"] = GData.get_user_image(dr["WF_TO_USER"].ToString());
                        dr["WF_STATUS_CLASS"]  = GData.get_status_class(dr["WF_STATUS"].ToString());
                        dr["WF_STATUS_TEXT"]   = GData.get_status_detail_name(dr["WF_STATUS"].ToString());
                    }
                }

                if (dt.Rows.Count == 1)
                {
                    DataRow dr           = dt.Rows[0];
                    string  WF_FROM_USER = dr["WF_FROM_USER"].ToString();
                    string  WF_STATUS    = dr["WF_STATUS"].ToString();
                    if (WF_FROM_USER == Cookies.UserCode && WF_STATUS == "0" && CancleAble)
                    {
                        CancleAble = true;
                    }
                    else
                    {
                        CancleAble = false;
                    }
                }
                else
                {
                    CancleAble = false;
                }

                if (dt.Rows.Count > 0)
                {
                    DataRow dr         = dt.Rows[0];
                    string  WF_TO_USER = dr["WF_TO_USER"].ToString();
                    string  WF_STATUS  = dr["WF_STATUS"].ToString();
                    if (WF_TO_USER == Cookies.UserCode && WF_STATUS == "0" && ApproveAble)
                    {
                        ApproveAble = true;
                    }
                    else
                    {
                        ApproveAble = false;
                    }
                }
                return(dt);
            }
            catch (Exception ex)
            {
                comm_fun.WriteLog(ex.ToString());
            }
            finally
            {
                comm_fun.CloseConnection(cn);
            }

            return(new DataTable());
        }