Esempio n. 1
0
        //取token数据
        private void getTokenData(string tokenTemplateId, string pageSize, string pageNo)
        {
            //取token
            String     viewDtostrToken = RestCall.httpGetMethod("http://192.168.1.7:5090/bill/generalView?tokenTemplateId=" + tokenTemplateId + "&pageSize=" + pageSize + "&pageNo=" + pageNo);
            Result     previewResult   = Newtonsoft.Json.JsonConvert.DeserializeObject <Result>(viewDtostrToken);
            PreviewDTO previewDTO      = Newtonsoft.Json.JsonConvert.DeserializeObject <PreviewDTO>(previewResult.data.ToString());

            //遍历token,给列赋值
            foreach (ReducedTokenDataDto tokenDataDto in previewDTO.datas.tokenDataDtoList)
            {
                DataRow dr = Dt.NewRow();
                dr["ID"] = tokenDataDto.tokenId;
                foreach (ReducedFkeyField fkeyField in tokenDataDto.fields)
                {
                    String caption = null;
                    RelationCaptionAndKey.TryGetValue(fkeyField.key, out caption);
                    string jsonData = fkeyField.jsonData;
                    switch (jsonData)
                    {
                    case "true":
                        jsonData = "男"; dr[caption] = jsonData; break;

                    case "false":
                        jsonData = "女"; dr[caption] = jsonData; break;

                    default:
                        dr[caption] = fkeyField.jsonData; break;
                    }
                    //dr[caption] = fkeyField.jsonData;
                }
                Dt.Rows.Add(dr);
            }
        }
Esempio n. 2
0
        public List <ReducedTokenDataDto> getReducedTokenDataDtos(string ttid)
        {
            String     viewDtostrToken = RestCall.httpGetMethod("http://192.168.1.7:5090/bill/generalView?tokenTemplateId=" + ttid + "&pageSize=" + "500" + "&pageNo=" + "1");
            Result     previewResult   = Newtonsoft.Json.JsonConvert.DeserializeObject <Result>(viewDtostrToken);
            PreviewDTO previewDTO      = Newtonsoft.Json.JsonConvert.DeserializeObject <PreviewDTO>(previewResult.data.ToString());

            return(previewDTO.datas.tokenDataDtoList);
        }
Esempio n. 3
0
        //取meta数据
        private void getMetaData(string metaId)
        {
            String             viewDtostrMeta = RestCall.httpGetMethod("http://192.168.1.7:5090/meta/findByMetaId?metaId=" + metaId);
            Result             metaInfos      = Newtonsoft.Json.JsonConvert.DeserializeObject <Result>(viewDtostrMeta);
            List <MetaInfoDTO> metaInfoDTOs   = Newtonsoft.Json.JsonConvert.DeserializeObject <List <MetaInfoDTO> >(metaInfos.data.ToString());

            foreach (MetaInfoDTO metaInfo in metaInfoDTOs)
            {
                this.Dt.Columns.Add(metaInfo.caption);
                RelationCaptionAndKey.Add(metaInfo.key, metaInfo.caption);
            }
        }
Esempio n. 4
0
        // 获取分录的token数据
        public static List <TokenDataDto> getEntryTokenData(String billTokenId, String billMetaId, String entryMetaId)
        {
            String resultStr = RestCall.httpGetMethod(ShujvweihuConfig.businessServiceUri + "/bill/entry/bill-meta-id/bill-token-id/entry-meta-id?entryMetaId="
                                                      + entryMetaId + "&billMetaId=" + billMetaId + "&billTokenId=" + billTokenId);
            Result result = Newtonsoft.Json.JsonConvert.DeserializeObject <Result>(resultStr);;

            if (result.resultCode == 0)
            {
                return(Newtonsoft.Json.JsonConvert.DeserializeObject <List <TokenDataDto> >(result.data.ToString()));
            }
            else
            {
                MessageBox.Show("获取数据失败!");
                return(null);
            }
        }
Esempio n. 5
0
        // 根据key获取常量
        //public static string[] getConstants(String key)
        //{
        //    string selectUserSQL = "SELECT name from constant WHERE fkey = '" + key + "' and enabled = TRUE";
        //    DataTable dt = DBUtil.ExecuteDataTable(selectUserSQL);
        //    if (null != dt || dt.Rows.Count > 0)
        //    {
        //        string constantsStr = dt.Rows[0][0].ToString();
        //        return constantsStr.Split(',');
        //    }
        //    return null;
        //}


        // 根据metaId和tokenId获取tokenDataDTO
        public static TokenDataDto getTokenDataDTO(String metaId, String tokenId)
        {
            String resultStr = RestCall.httpGetMethod(ShujvweihuConfig.businessServiceUri + "/bill/bill/meta-id/token-id?metaId="
                                                      + metaId + "&tokenId=" + tokenId);
            Result result = Newtonsoft.Json.JsonConvert.DeserializeObject <Result>(resultStr);;

            if (result.resultCode == 0 && null != result.data)
            {
                return(Newtonsoft.Json.JsonConvert.DeserializeObject <TokenDataDto>(result.data.ToString()));
            }
            else
            {
                MessageBox.Show("获取数据失败!");
                return(null);
            }
        }
Esempio n. 6
0
        public ChangeService change(string metaid, string tokenid)
        {
            //this.WindowState = FormWindowState.Maximized;
            String             viewDtostrMeta = RestCall.httpGetMethod("http://192.168.1.7:5090/meta/findByMetaId?metaId=" + metaid);
            Result             metaInfos      = Newtonsoft.Json.JsonConvert.DeserializeObject <Result>(viewDtostrMeta);
            List <MetaInfoDTO> metaInfoDTOs   = Newtonsoft.Json.JsonConvert.DeserializeObject <List <MetaInfoDTO> >(metaInfos.data.ToString());

            //遍历meta,将meta放出列名
            foreach (MetaInfoDTO metaInfo in metaInfoDTOs)
            {
                RelationCaptionAndKey.Add(metaInfo.key, metaInfo.caption);
            }
            String viewDtostrToken = RestCall.httpGetMethod("http://192.168.1.7:5090/bill/getBillDetail?metaId=" + metaid + "&tokenId=" + tokenid);

            Result previewResult = Newtonsoft.Json.JsonConvert.DeserializeObject <Result>(viewDtostrToken);

            Metadatas = Newtonsoft.Json.JsonConvert.DeserializeObject <Metadata>(previewResult.data.ToString());
            return(this);
        }
Esempio n. 7
0
 // 调用存储过程
 public static void storeProcedure(String metaId, String tokenId)
 {
     String resultStr = RestCall.httpGetMethod(ShujvweihuConfig.businessServiceUri + "/bill/submit/storeProcedure?metaId="
                                               + metaId + "&tokenId=" + tokenId);
 }
Esempio n. 8
0
        /// <summary>
        /// 订单信息保存
        /// </summary>
        private void stylechangesave_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show("确认保存吗?", "保存", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dialogResult == DialogResult.Yes)
            {
                if (Frm面料选择.mianliaoid == "" || this.chicun01.Text == "" || this.shuliang.Text == "")
                {
                    MessageBox.Show("请填写完整");
                    return;
                }
                DataRow drstylefit   = SQLmtm.GetDataRow("SELECT MAX(STYLE_FIT_ID) as STYLE_FIT_ID FROM `a_customer_fit_value_r`");
                int     sTYLE_FIT_ID = Convert.ToInt32(drstylefit["STYLE_FIT_ID"]);
                sTYLE_FIT_ID++;
                DataRow drcustomer   = SQLmtm.GetDataRow("select * from a_customer_p where CUSTOMER_ID='" + Frm客户.cUSTOMER_ID.ToString() + "'");
                string  customername = Convert.ToString(drcustomer["CUSTOMER_FIRST_NAME"]) + Convert.ToString(drcustomer["CUSTOMER_LAST_NAME"]);
                sTYLE_SIZE_CD = SizeService.SizeCD(this.chicun01.Text.Trim(), stylesizedt);
                DataRow drstyle = SQLmtm.GetDataRow("SELECT MAX(SYS_STYLE_ID) SYS_STYLE_ID FROM `s_style_p`");
                styleid = Convert.ToInt32(drstyle["SYS_STYLE_ID"]);
                styleid++;
                //a_customer_fit_value_r,s_style_fit_r表存储
                //ImpService.insertFit_R(sTYLE_FIT_ID, customername, fitv, ftvl, inftvl, outftvl);
                //动态尺寸保存
                ImpService.DynamicSaveSize(this, sTYLE_FIT_ID, customername);

                //s_style_p储存
                ImpService.insertS_Style_P(this, uc);
                //s_style_fit_r


                //设计点保存
                //ImpService.SaveDesign(this);
                ImpService.DynamicSaveDesign(this);
                //o_order_p
                //RestCall.httpGetMethod("https://shirtmtm.com/fragsmart-mtm/customer/update/payment?styleId=" + styleid.ToString() + "&customerId=" + CreateCustomer.cUSTOMER_ID.ToString() + "&addressId=" + CreateCustomer.aDDRESS_ID.ToString() + "&number=" + this.shuliang.Text);
                RestCall.httpGetMethod("http://localhost:8080/customer/update/payment?styleId=" + styleid.ToString() + "&customerId=" + Frm客户.cUSTOMER_ID.ToString() + "&addressId=" + Frm客户.aDDRESS_ID.ToString() + "&number=" + this.shuliang.Text);
                DataRow ORDER_ID = SQLmtm.GetDataRow("SELECT MAX(ORDER_ID) AS ORDER_ID FROM `o_order_p`");
                int     order_id = Convert.ToInt32(ORDER_ID["ORDER_ID"]);
                //order_id++;
                SQLmtm.DoInsert("o_order_brand_r", new string[] { "OGNIZATION_ID", "SHOP_ID", "BRAND_ID", "ORDER_ID" }, new string[] { "95", "18", "", order_id.ToString() });
                SQLmtm.DoInsert("t_order_type", new string[] { "ORDER_ID", "ORDER_TYPE" }, new string[] { order_id.ToString(), "1" });
                if (Convert.ToInt32(this.shuliang.Text) == Convert.ToInt32(this.shuliang.Text))
                {
                    MessageBox.Show("保存成功!");
                    //this.closeForm();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("保存失败");
                }
            }
            //else
            //{
            //    MessageBox.Show("请填写完整");
            //    //return;
            //}
            else
            {
                return;
            }
        }