Esempio n. 1
0
        public static string GetSectionNames(NpgsqlConnection conn, string ids)
        {
            string localeCode = CommonUtil.GetAppLocaleCode();

            string result_value;

            if (ids != null && ids != "")
            {
                if (ids.Contains(":"))
                {
                    string valueFieldName = "section_name_" + localeCode;
                    //  不在転送リストから部署名を取得
                    string[] values = ids.Split(':');
                    string   name1  = BaseModel.GetFirstValue <string>(conn, SectionMaster.SelectNameSql(localeCode, values[0]), valueFieldName);
                    string   name2  = BaseModel.GetFirstValue <string>(conn, SectionMaster.SelectNameSql(localeCode, values[1]), valueFieldName);
                    result_value = name1;
                    if (name2 != null)
                    {
                        result_value += "(" + name2 + ")";
                    }
                }
                else
                {
                    //  立ち寄り部署ID一覧から部署名をカンマ区切りで取得
                    result_value = BaseModel.GetFirstValue <string>(conn, SectionMaster.SelectNamesSql(localeCode, ids), "value");
                }
            }
            else
            {
                result_value = "";
            }
            return(result_value);
        }
Esempio n. 2
0
        public static string GetListSql(string cart_enable)
        {
            string localeCode = CommonUtil.GetAppLocaleCode();

            string sql =
                "SELECT " +
                "lpad(cast(cart_id as text),4,'0') AS id" +
                ",cart_name_" + localeCode + " AS name" +
                ",CASE cart_use WHEN 0 THEN '" + Properties.Resources.CLV_USE_0 + "'" +
                "WHEN 1 THEN '" + Properties.Resources.CLV_USE_1 + "'" +
                "WHEN 2 THEN '" + Properties.Resources.CLV_USE_2 + "'" +
                "ELSE '' " +
                "END As use" +
                ",CASE WHEN cart_enable = 1 THEN '" + Properties.Resources.CLV_ENABLE_1 + "' ELSE '" + Properties.Resources.CLV_ENABLE_0 + "' END AS enable" +
                ",(" + SectionMaster.SelectNameSql(localeCode, "cart_master.cart_section_id") + ") AS belong_sect" +                                                                       // 所属部署名
                ",CASE WHEN cart_sect_restrict_flg = 0 THEN '" + Properties.Resources.CLV_RESTRICT_0 + "' ELSE '" + Properties.Resources.CLV_RESTRICT_NOT_0 + "' END AS belong_restrict" + //  所属部署制限
                ",cart_master.cart_dest_id AS dest_sect" +                                                                                                                                 // 行先部署
                ",CASE WHEN cart_dest_restrict_flg = 0 THEN '" + Properties.Resources.CLV_RESTRICT_0 + "' ELSE '" + Properties.Resources.CLV_RESTRICT_NOT_0 + "' END AS dest_restrict" +   //  行先部署制限
                ",CASE cart_func WHEN 1 THEN '" + Properties.Resources.CLV_FUNC_1 + "'" +
                "WHEN 2 THEN '" + Properties.Resources.CLV_FUNC_2 + "'" +
                "ELSE '' " +
                "END As func" +
                ",'' AS key" +
                " FROM cart_master";

            if (cart_enable != "all")
            {
                sql += " WHERE cart_enable=" + cart_enable;
            }
            sql += " ORDER BY cart_id ASC";
            return(sql);
        }
Esempio n. 3
0
        public static string GetListSql(string conditionSql)
        {
            string localeCode = CommonUtil.GetAppLocaleCode();

            string sql =
                "SELECT" +
                " to_char(order_result_reserve_datetime, '" + Properties.Resources.FORMAT_DATE + "') as reserve_date" +
                ",to_char(order_result_reserve_datetime, 'HH24:MI:SS') as reserve_time" +
                ",to_char(order_result_start_datetime, '" + Properties.Resources.FORMAT_DATE + "') as start_date" +
                ", to_char(order_result_start_datetime, 'HH24:MI:SS') as start_time" +
                ", to_char(order_result_datetime, '" + Properties.Resources.FORMAT_DATE + "') as result_date" +
                ", to_char(order_result_datetime, 'HH24:MI:SS') as result_time" +
                ", (" + SectionMaster.SelectNameSql(localeCode, "order_result_from_sect") + ") AS req_sect" +
                ", (" + StationMaster.SelectNameByPointSql(localeCode, "order_result_from_pt") + ") AS req_station" +
                ", CASE WHEN order_result_round_flg = 1 OR order_result_forward_list is NULL THEN order_result_stop_to_sects ELSE order_result_forward_list END AS to_sect" +
                ", order_result_stop_to_points AS to_station" +
                ", (" + CartMaster.SelectNameSql(localeCode, "order_result_cart_id") + ") AS cart_id" +
                ", (" + MuMaster.SelectNameSql(localeCode, "order_result_mu_id") + ") AS mu_id" +
//    ", order_result_cart_id AS cart_id" +
//    ", order_result_mu_id AS mu_id" +
                ", CASE order_result_status WHEN 0 THEN '" + Mocs.Properties.Resources.ORDER_RESULT_STATUS_0 + "' WHEN 1 THEN '" + Mocs.Properties.Resources.ORDER_RESULT_STATUS_1 + "' WHEN 10 THEN '" + Mocs.Properties.Resources.ORDER_RESULT_STATUS_10 + "' WHEN 20  THEN '" + Mocs.Properties.Resources.ORDER_RESULT_STATUS_20 + "' WHEN 100 THEN '" + Mocs.Properties.Resources.ORDER_RESULT_STATUS_100 + "' ELSE CAST(order_result_status AS text) END AS status" +
                " FROM order_result_log";

            if (conditionSql == null || conditionSql.Length == 0)
            {
                conditionSql = DBAccess.GetTodayConditionSql("order_result_datetime");
            }
            sql += " WHERE " + conditionSql;
            sql += " ORDER BY order_result_datetime DESC, order_result_start_datetime DESC, order_result_reserve_datetime DESC";

            return(sql);
        }
Esempio n. 4
0
        public static string GetListSql(string conditionSql, string comboValue)
        {
            string localeCode = CommonUtil.GetAppLocaleCode();

            string sql =
                "SELECT" +
                " to_char(sectlog_datetime, 'yyyy-MM-dd') as date" +
                ",to_char(sectlog_datetime, 'HH24:MI:SS') as time" +
                ", (" + SectionMaster.SelectNameSql(localeCode, "sectlog_sect_id") + ") AS sect" +              //  部署名
                ", CASE WHEN sectlog_absence_flg=1 THEN '" + Properties.Resources.ALV_ABSENCE_1 + "' ELSE '" + Properties.Resources.ALV_ABSENCE_0 + "' END AS absence" +
                ", (" + SectionMaster.SelectNameSql(localeCode, "sectlog_forward_sect") + ") AS forward_sect" + //  転送先部署名
                " FROM sect_status_log";

            string comboCondition = null;

            if (comboValue == "1")
            {
                comboCondition = "sectlog_absence_flg=1";
            }
            else if (comboValue == "0")
            {
                comboCondition = "sectlog_absence_flg=0";
            }
            if (conditionSql == null || conditionSql.Length == 0)
            {
                conditionSql = DBAccess.GetTodayConditionSql("sectlog_datetime");
            }
            sql += " WHERE " + conditionSql;

            if (comboCondition != null)
            {
                sql += " AND " + comboCondition;
            }
            sql += " ORDER BY sectlog_datetime DESC";

            return(sql);
        }