コード例 #1
0
ファイル: QuoteClose.aspx.cs プロジェクト: evelh/Done
        /// <summary>
        /// 为页面上的下拉框赋值的jquery
        /// </summary>
        /// <returns></returns>
        private string ReturnJquery()
        {
            var scriptText = "";

            if (quoteItemList != null && quoteItemList.Count > 0)
            {
                foreach (var item in quoteItemList)
                {
                    if (item.object_id != null)
                    {
                        if (item.type_id == (int)QUOTE_ITEM_TYPE.PRODUCT)
                        {
                            var product = new EMT.DoneNOW.BLL.ProductBLL().GetProduct((long)item.object_id);
                            if (product != null)
                            {
                                scriptText += $"$('#{item.id}_select').val({product.cost_code_id});";
                            }
                        }
                        if (item.type_id == (int)QUOTE_ITEM_TYPE.DEGRESSION)
                        {
                            scriptText += $"$('#{item.id}_select').val({item.object_id});";
                        }
                    }
                }
            }
            return(scriptText);
        }
コード例 #2
0
ファイル: QuoteItemManage.aspx.cs プロジェクト: evelh/Done
        private string ReturnProductID(long object_id)
        {
            var product = new EMT.DoneNOW.BLL.ProductBLL().GetProduct(object_id);

            if (product != null)
            {
                return(product.id.ToString());
            }
            return("");
        }
コード例 #3
0
        /// <summary>
        /// 根据不同的报价项选择不同的物料代码(执行不同的jquery代码放到前端执行)
        /// </summary>
        /// <returns></returns>
        private string ReturnJquery()
        {
            var scriptText = "";

            if (proAndOneTimeItem != null && proAndOneTimeItem.Count > 0)
            {
                foreach (var item in proAndOneTimeItem)
                {
                    if (item.object_id != null)
                    {
                        var product = new EMT.DoneNOW.BLL.ProductBLL().GetProduct((long)item.object_id);
                        if (product != null)
                        {
                            scriptText += $"$('#{item.id}_select').val({product.cost_code_id});";
                        }
                    }
                }
            }
            // SHIPITEM_COSTCODE_CLOSE
            if (shipItem != null && shipItem.Count > 0)
            {
                var sysSet = new SysSettingBLL().GetSetById(SysSettingEnum.SHIPITEM_COSTCODE_CLOSE);

                foreach (var item in shipItem)
                {
                    if (item.object_id != null)
                    {
                        var thisGeneral = new d_general_dal().GetGeneralById((long)item.object_id);
                        if (thisGeneral.parent_id != null)
                        {
                            scriptText += $"$('#{item.id}_select').val({thisGeneral.parent_id});";
                        }
                    }
                    else if (sysSet != null && (!string.IsNullOrEmpty(sysSet.setting_value)))
                    {
                        scriptText += $"$('#{item.id}_select').val({sysSet.setting_value});";
                    }
                }
            }
            if (degressionItem != null && degressionItem.Count > 0)
            {
                foreach (var item in proAndOneTimeItem)
                {
                    if (item.object_id != null)
                    {
                        scriptText += $"$('#{item.id}_select').val({item.object_id});";
                    }
                }
            }
            return(scriptText);
        }