Exemplo n.º 1
0
        internal bool IsExistPlanDefineRef(string planDefineID)
        {
            if (string.IsNullOrEmpty(planDefineID))
            {
                return(false);
            }
            var result = db.ExecuteScalar(@"select count(1) from plan where plandefineid={0}", planDefineID);

            return(Convert.ToInt32(result) > 0);
        }
Exemplo n.º 2
0
        public string ctdgSelect_zjnb(string id, string code, string formid)
        {
            MobileQueryExtension aa = new MobileQueryExtension();

            Log("资金内部方法执行成功");
            IGSPDatabase db    = GSPContext.Current.Database;
            int          count = Convert.ToInt32(db.ExecuteScalar("SELECT COUNT(1) COUNT FROM XDDKHT WHERE XDDKHT_HTNM = {0}", id));

            Log(count);
            JObject jo = new JObject();

            jo["id"]   = id;
            jo["name"] = code;
            //string url = String.Format("/cwbase/web/session/gspadp/AdpRuntime.aspx?formID={1}&dataID={0}&actionID=view", id, formid);
            //jo["url"] = String.Format("/cwbase/web/session/gsprtf/adpdebug.aspx?adpurl={0}", Uri.EscapeDataString(url));
            //string url = aa.GetUrlBizApply(id,Platform.MOBILE);
            GSPState gspState = GSPContext.Current.Session;
            string   gsCode   = gspState.AppCode;//GS实例编号
            string   viewType = ViewType.原始单据.ToString();

            string url = String.Format("/cwbase/webapp/gspqdp/{3}.html?viewType={4}&sysCode={0}&FormID={1}&dataid={2}", gsCode, formid, id, "PackPage", viewType);

            jo["url"] = String.Format("/cwbase/web/session/gsprtf/adpdebug.aspx?adpurl={0}", Uri.EscapeDataString(url));
            string result = count <= 0 ? String.Empty : jo.ToString();

            Log(result);
            return(result);
        }
Exemplo n.º 3
0
        public string ctdgSelect_gx(string id, string code)
        {
            IGSPDatabase db       = GSPContext.Current.Database;
            string       billType = Convert.ToString(db.ExecuteScalar("SELECT MAX(FSYXDJ_DJLX) FROM FSYXDJ WHERE FSYXDJ_DJNM = {0}", id));
            JObject      jo       = new JObject();

            jo["id"]   = id;
            jo["name"] = code;
            string url = String.Format("/cwbase/web/ro/ywcl/2fc63df3-0b0c-42c4-96c3-2bdee5aa0763/Index.html?isruntime=1&operation=VIEW&mode=CX&secondlatitude=SQ&firstlatitude={1}&nm={0}", id, billType);

            jo["url"] = String.Format("/cwbase/web/session/gsprtf/adpdebug.aspx?adpurl={0}", Uri.EscapeDataString(url));
            string result = String.IsNullOrWhiteSpace(billType) ? String.Empty : jo.ToString();

            return(result);
        }
        /// <summary>
        /// 根据原始单据内码获取原始单据的共享联查url
        /// </summary>
        /// <param name="id">原始单据内码</param>
        /// <param name="platform">pc||mobile</param>
        /// <returns>原始单据的共享联查url</returns>
        public string GetUrlBizApply(string id, Platform platform)
        {
            GSPState     gspState = GSPContext.Current.Session;
            IGSPDatabase db       = GSPContext.Current.Database;
            string       gsCode   = gspState.AppCode; //GS实例编号
            string       formID   = Convert.ToString(db.ExecuteScalar(@"WITH
            T1 AS (SELECT SRCCOL01, TARCOL FROM DEPVMVALUELIST WHERE VMID IN (SELECT ID FROM DEPVALUEMAPPING WHERE CODE = '2005')),
            T2 AS (SELECT TARCOL FROM T1 WHERE SRCCOL01 IN (SELECT ROYWSQ_SQLX FROM ROYWSQ WHERE ROYWSQ_NM = {0}))
            SELECT MAX(TARCOL) TARCOL FROM T2", id)); //申请类型内码映射申请单据定义内码2005
            string       page     = platform.Equals(Platform.PC) ? "webbillQueryADPphone" : "PackPage";
            string       viewType = ViewType.原始单据.ToString();
            string       url      = String.Format("/cwbase/webapp/gspqdp/{3}.html?viewType={4}&sysCode={0}&FormID={1}&dataid={2}", gsCode, formID, id, page, viewType);

            WriteLog(url, "url");
            return(String.IsNullOrWhiteSpace(formID) ? String.Empty : Uri.EscapeUriString(url));
        }
Exemplo n.º 5
0
        public string ctdgSelect_zccg(string id, string code, string formid)
        {
            IGSPDatabase db    = GSPContext.Current.Database;
            int          count = Convert.ToInt32(db.ExecuteScalar("SELECT COUNT(1) COUNT FROM AMCGSQ WHERE AMCGSQ_DJID = {0}", id));
            JObject      jo    = new JObject();

            jo["id"]   = id;
            jo["name"] = code;
            string url = String.Format("/cwbase/web/session/gspadp/AdpRuntime.aspx?formID={1}&dataID={0}&actionID=view", id, formid);

            jo["url"] = String.Format("/cwbase/web/session/gsprtf/adpdebug.aspx?adpurl={0}", Uri.EscapeDataString(url));
            //Log(jo["url"]);
            string result = count <= 0 ? String.Empty : jo.ToString();

            return(result);
        }
Exemplo n.º 6
0
        public bool IsExistCustomizedModel(string planDefineID)
        {
            string sql = $@"select count(1) from planitemcustomization where plandefineid='{planDefineID}' and tenantid='{Utils.GetTenantId()}'";

            return(Convert.ToInt32(db.ExecuteScalar(sql)) > 0);
        }
Exemplo n.º 7
0
        public string ctdgSelect_all(string id, string code)
        {
            Log("all方法执行成功");
            Log("id=" + id + ",code=" + code);
            string tmp;

            if (code.Length >= 4)
            {
                tmp = code.Substring(0, 4).ToUpper();
                Log("code=" + code);
            }

            else
            {
                return(string.Empty);
            }
            IGSPDatabase db = GSPContext.Current.Database;
            //tarcol:两个字母  例如:ZC GX ZJ
            //srccol02: ca098f65-1512-4f78-8c8e-d552730f42f3 41000824-ec02-474f-b974-55bf8f75fa10 22d9394c-5c89-4122-a574-ca492322ab0d
            string tarcol = Convert.ToString(db.ExecuteScalar("SELECT TARCOL FROM DEPVMVALUELIST WHERE VMID IN (SELECT ID FROM DEPVALUEMAPPING WHERE CODE = 'CT_LC' AND SRCCOL01={0})", tmp));

            //string srccol02 = Convert.ToString(db.ExecuteScalar("SELECT SRCCOL02 FROM DEPVMVALUELIST WHERE VMID IN (SELECT ID FROM DEPVALUEMAPPING WHERE CODE = 'CT_LC' AND SRCCOL01={0})", tmp));

            switch (tarcol)
            {
            case "GX": return(ctdgSelect_gx(id, code)); break;

            case "ZC":
            {
                string str = String.Empty;
                str = this.ctdgSelect_zccg(id, code, "ca098f65-1512-4f78-8c8e-d552730f42f3");        //调用资产采购
                if (!String.IsNullOrWhiteSpace(str))
                {
                    return(str);
                }
                str = this.ctdgSelect_zcwx(id, code, "41000824-ec02-474f-b974-55bf8f75fa10");        //调用资产维修
                if (!String.IsNullOrWhiteSpace(str))
                {
                    return(str);
                }
                str = this.ctdgSelect_zczr(id, code, "22d9394c-5c89-4122-a574-ca492322ab0d");        //调用资产租入
                if (!String.IsNullOrWhiteSpace(str))
                {
                    return(str);
                }
                else
                {
                    return(string.Empty);
                }

                #region
                //    if (srccol02 == "ca098f65-1512-4f78-8c8e-d552730f42f3")
                //    {
                //        return ctdgSelect_zccg(id, code, "ca098f65-1512-4f78-8c8e-d552730f42f3");
                //    }
                //    else if (srccol02 == "41000824-ec02-474f-b974-55bf8f75fa10")
                //    {
                //        return ctdgSelect_zcwx(id, code, "41000824-ec02-474f-b974-55bf8f75fa10");
                //    }
                //    else if (srccol02 == "22d9394c-5c89-4122-a574-ca492322ab0d")
                //    {
                //        return ctdgSelect_zczr(id, code, "22d9394c-5c89-4122-a574-ca492322ab0d");
                //    }

                //    else
                //    {
                //        return string.Empty;
                //    }

                //}; break;
                #endregion
            } break;

            case "ZJ":
            {
                Log("进入case ZJ");
                string str = String.Empty;
                str = this.ctdgSelect_zjnb(id, code, "11446bcf-30dc-43f7-b860-54e79ff5ce3f");        //调用资金内部
                if (!String.IsNullOrWhiteSpace(str))
                {
                    return(str);
                }
                //str = this.ctdgSelect_zjwb(id, code, "41000824-ec02-474f-b974-55bf8f75fa10");//调用资金外部
                //if (!String.IsNullOrWhiteSpace(str))
                //{
                //    return str;
                //}
                else
                {
                    return(string.Empty);
                }
            } break;

            default: return(string.Empty);
            }
        }