コード例 #1
0
        /// <summary>
        /// 查询
        /// </summary>
        private void DoSelect()
        {
            SearchCriterion.AddSearch("UserId", UserInfo.UserID);
            string where = "";
            foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches)
            {
                if (!String.IsNullOrEmpty(item.Value.ToString()) && item.PropertyName == "Month")
                {
                    where += " month(ApplyTime)=" + item.Value.ToString() + " ";
                }
                if (!String.IsNullOrEmpty(item.Value.ToString()) && item.PropertyName == "Year")
                {
                    where += " Year(ApplyTime)=" + item.Value.ToString() + " ";
                }
            }
            if (!string.IsNullOrEmpty(where))
            {
                SearchCriterion.Searches.RemoveSearch("Month");
                SearchCriterion.Searches.RemoveSearch("Year");
                ents = UsrChildWelfare.FindAll(SearchCriterion, Expression.Sql(where));
            }
            else
            {
                ents = UsrChildWelfare.FindAll(SearchCriterion);
            }

            this.PageState.Add("UsrChildWelfareList", ents);
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            cid   = RequestData.Get <string>("cid", String.Empty);
            type  = RequestData.Get <string>("type", String.Empty).ToLower();
            ctype = RequestData.Get <string>("ctype", "role").ToLower();

            if (!String.IsNullOrEmpty(cid))
            {
                try
                {
                    int icid = Convert.ToInt32(cid);

                    SearchCriterion.AddSearch("Type", icid);

                    ents = SysRoleRule.FindAll(SearchCriterion);
                }
                catch { }
            }
            else
            {
                ents = SysRoleRule.FindAll(SearchCriterion);
            }

            this.PageState.Add("DtList", ents);
        }
コード例 #3
0
        private void DoSelect()
        {
            sql = @"select Id as IndicatorFirstId ,IndicatorFirstName  from BJKY_Examine..IndicatorFirst 
                      where  ExamineIndicatorId = '" + ExamineIndicatorId + "' order by SortIndex asc ";
            EasyDictionary dic = DataHelper.QueryDict(sql, "IndicatorFirstId", "IndicatorFirstName");

            PageState.Add("IndictorFirstEnum", dic);//Combo数据集
            if (op != "c" && op != "cs")
            {
                if (!String.IsNullOrEmpty(id))
                {
                    ent = IndicatorSecond.Find(id);
                }
                SetFormData(ent);
                SearchCriterion.AddSearch(ScoreStandard.Prop_IndicatorSecondId, id);
                SearchCriterion.SetOrder("SortIndex", true);
                ents = ScoreStandard.FindAll(SearchCriterion);
                PageState.Add("DataList", ents);
            }
            else
            {
                if (!string.IsNullOrEmpty(IndicatorFirstId))
                {
                    IndicatorFirst ifEnt = IndicatorFirst.Find(IndicatorFirstId);
                    sql = "select isnull(max(SortIndex),0) from BJKY_Examine..IndicatorSecond where IndicatorFirstId='" + IndicatorFirstId + "'";
                    var obj = new
                    {
                        SortIndex          = DataHelper.QueryValue <int>(sql) + 1,
                        ExamineIndicatorId = ExamineIndicatorId
                    };
                    SetFormData(obj);
                }
            }
        }
コード例 #4
0
        private void DoSelect()
        {
            string index = RequestData.Get <string>("Index");

            string where = "";
            string detailwhere      = "";
            string payState         = RequestData.Get <string>("PayState");
            string inWarehouseState = RequestData.Get <string>("InWarehouseState");
            string orderState       = RequestData.Get <string>("OrderState");

            if (!string.IsNullOrEmpty(payState))
            {
                SearchCriterion.AddSearch("PayState", payState);
            }
            if (!string.IsNullOrEmpty(inWarehouseState))
            {
                SearchCriterion.AddSearch("InWarehouseState", inWarehouseState);
            }
            if (!string.IsNullOrEmpty(orderState))
            {
                SearchCriterion.AddSearch("OrderState", orderState);
            }
            string sql = string.Empty;

            foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches)
            {
                if (item.PropertyName == "BeginDate" && item.Value.ToString() != "")
                {
                    where += " and CreateTime>'" + item.Value + "' ";
                }
                else if (item.PropertyName == "EndDate" && item.Value.ToString() != "")
                {
                    where += " and CreateTime<'" + (item.Value.ToString()).Replace(" 0:00:00", " 23:59:59") + "' ";
                }
                else if (item.Value.ToString() != "")
                {
                    if (item.PropertyName != "Code")
                    {
                        where += " and " + item.PropertyName + " like '%" + item.Value + "%'";
                    }
                    else
                    {
                        detailwhere = "where " + item.PropertyName + " like '%" + item.Value + "%'";
                    }
                }
            }
            if (index == "0")
            {
                sql = @"select A.* from SHHG_AimExamine..PurchaseOrder as A                       
                where A.InWarehouseState='未入库' and A.Id in 
                (select distinct PurchaseOrderId from SHHG_AimExamine..PurchaseOrderDetail " + detailwhere + ")" + where;
            }//采购人员也能看到别人做的采购订单所以这里不加人员过滤
            else
            {
                sql = @"select A.* from SHHG_AimExamine..PurchaseOrder as A           
                where A.InWarehouseState='已入库' and  A.Id in
                (select distinct PurchaseOrderId from SHHG_AimExamine..PurchaseOrderDetail " + detailwhere + ")" + where;
            }
            PageState.Add("PurchaseOrderList", GetPageData(sql, SearchCriterion));
        }
コード例 #5
0
        private void DoSelect()
        {
            CommPowerSplit ps = new CommPowerSplit();

            if (ps.IsSurveyRole(UserInfo.UserID, UserInfo.LoginName))
            {
                SearchCriterion.SetSearch("IsFixed", "2");  //固定问卷
                SurveyQuestion[] Ents = SurveyQuestion.FindAll(SearchCriterion);
                this.PageState.Add("DataList", Ents);
            }
            else
            {
                SearchCriterion.SetSearch("IsFixed", "2");  //固定问卷
                string CompanyId = string.Empty;            //公司ID

                //first depend login corpid
                var             Ent = SysUser.Find(UserInfo.UserID);
                UserContextInfo UC  = new UserContextInfo();
                CompanyId = UC.GetUserCurrentCorpId(UserInfo.UserID);

                SearchCriterion.AddSearch("CompanyId", CompanyId);
                SurveyQuestion[] Ents = SurveyQuestion.FindAll(SearchCriterion);
                this.PageState.Add("DataList", Ents);
            }
        }
コード例 #6
0
        private void DoSelect()
        {
            SearchCriterion.AddSearch(ExamineTask.Prop_ExamineStageId, ExamineStageId);
            IList <ExamineStageResult> esrEnts = ExamineStageResult.FindAll(SearchCriterion);

            PageState.Add("DataList", esrEnts);
        }
コード例 #7
0
        /// <summary>
        /// 查询
        /// </summary>
        private void DoSelect()
        {
            string QuestionId = RequestData.Get <string>("Id");

            SearchCriterion.AddSearch(EmpVoiceAnswerInfo.Prop_QuestionId, QuestionId);
            ents = EmpVoiceAnswerInfo.FindAll(SearchCriterion);
            this.PageState.Add("EmpVoiceAnswerInfoList", ents);
        }
コード例 #8
0
        string code = String.Empty; // 编码

        #endregion

        #region 构造函数

        #endregion

        #region ASP.NET 事件

        protected void Page_Load(object sender, EventArgs e)
        {
            op   = RequestData.Get <string>("op");
            id   = RequestData.Get <string>("id");
            type = RequestData.Get <string>("type");
            code = RequestData.Get <string>("code");

            DynamicAuthCatalog dac = null; // 动态权限类型

            SearchCriterion sc = new HqlSearchCriterion();

            SearchCriterion.SetOrder("SortIndex");
            SearchCriterion.SetOrder("CreatedDate");
            SearchCriterion.AddSearch("EditStatus", "G", SearchModeEnum.Like);  // 只显示允许授权的节点

            if (type == "catalog")
            {
                if (String.IsNullOrEmpty(code) && !String.IsNullOrEmpty(id))
                {
                    dac  = DynamicAuthCatalog.Find(id);
                    code = dac.Code;
                }

                if (!String.IsNullOrEmpty(code))
                {
                    SearchCriterion.AddSearch("CatalogCode", code);
                    SearchCriterion.AddSearch("ParentID", SingleSearchModeEnum.IsNull);

                    ents = DynamicAuthRule.FindAll(SearchCriterion);

                    if (dac == null)
                    {
                        dac = DynamicAuthCatalog.FindFirst(Expression.Eq("Code", code));
                    }
                }
            }
            else if (!String.IsNullOrEmpty(id))
            {
                SearchCriterion.AddSearch("ParentID", id);

                ents = DynamicAuthRule.FindAll(SearchCriterion);

                DynamicAuth da = DynamicAuth.Find(id);
                dac = DynamicAuthCatalog.FindFirst(Expression.Eq("Code", da.CatalogCode));
            }

            this.PageState.Add("EntList", ents);

            if (!IsAsyncRequest)
            {
                if (dac != null)
                {
                    IList <DynamicPermissionCatalog> dpcs = dac.AllowGrantPermissionCatalog;
                    this.PageState.Add("PCatalogList", dpcs);
                }
            }
        }
コード例 #9
0
        /// <summary>
        /// 选择操作
        /// </summary>
        private void DoSelect()
        {
            DynamicAuthCatalog dac = null; // 动态权限类型

            SearchCriterion sc = new HqlSearchCriterion();

            SearchCriterion.SetOrder("SortIndex");
            SearchCriterion.SetOrder("CreatedDate");
            SearchCriterion.AddSearch("EditStatus", "G", SearchModeEnum.Like);  // 只显示允许授权的节点

            if (type == "catalog")
            {
                if (String.IsNullOrEmpty(code) && !String.IsNullOrEmpty(id))
                {
                    dac  = DynamicAuthCatalog.Find(id);
                    code = dac.Code;
                }

                if (!String.IsNullOrEmpty(code))
                {
                    SearchCriterion.AddSearch("CatalogCode", code);
                    SearchCriterion.AddSearch("ParentID", SingleSearchModeEnum.IsNull);

                    ents = DynamicAuthRule.FindAll(SearchCriterion);

                    if (dac == null)
                    {
                        dac = DynamicAuthCatalog.FindFirst(Expression.Eq("Code", code));
                    }
                }
            }
            else if (!String.IsNullOrEmpty(id))
            {
                SearchCriterion.AddSearch("ParentID", id);

                ents = DynamicAuthRule.FindAll(SearchCriterion);

                DynamicAuth da = DynamicAuth.Find(id);
                dac = DynamicAuthCatalog.FindFirst(Expression.Eq("Code", da.CatalogCode));
            }

            this.PageState.Add("EntList", ents);

            if (!IsAsyncRequest)
            {
                if (dac != null)
                {
                    IList <DynamicPermissionCatalog> dpcs = dac.AllowGrantPermissionCatalog;
                    this.PageState.Add("PCatalogList", dpcs);

                    this.PageState.Add("AllowOperation", dac.GetAllowOperations()); // 允许的操作
                }

                this.PageState.Add("OpDivChar", DynamicOperations.DivChar); // 操作分割符
            }
        }
コード例 #10
0
        string code = String.Empty; // 对象类型

        #endregion

        #region 构造函数

        #endregion

        #region ASP.NET 事件

        protected void Page_Load(object sender, EventArgs e)
        {
            op   = RequestData.Get <string>("op");
            id   = RequestData.Get <string>("id");
            code = RequestData.Get <string>("code");

            if (IsAsyncRequest)
            {
                DynamicAuth ent = null;

                switch (this.RequestAction)
                {
                case RequestActionEnum.Read:
                case RequestActionEnum.Query:
                case RequestActionEnum.Default:
                    if (SearchCriterion.Orders.Count <= 0)
                    {
                        SearchCriterion.SetOrder("SortIndex");
                        SearchCriterion.SetOrder("CreatedDate");
                    }

                    SearchCriterion.AddSearch("CatalogCode", code);
                    SearchCriterion.AddSearch("EditStatus", SingleSearchModeEnum.IsNotNull);
                    SearchCriterion.AddSearch("EditStatus", "", SearchModeEnum.NotEqual);

                    if (String.IsNullOrEmpty(id))
                    {
                        SearchCriterion.AddSearch("ParentID", SingleSearchModeEnum.IsNull);
                    }
                    else
                    {
                        SearchCriterion.AddSearch("ParentID", id);
                    }

                    ents = DynamicAuthRule.FindAll(SearchCriterion);
                    break;

                case RequestActionEnum.Delete:
                    ent = DynamicAuth.Find(id);
                    ent.DoDelete();
                    this.SetMessage("删除成功!");
                    break;
                }

                this.PageState.Add("EntList", ents);
            }
            else
            {
                SearchCriterion sc = new HqlSearchCriterion();
                sc.SetOrder("SortIndex");
                sc.SetOrder("CreatedDate");
                DynamicAuthCatalog[] entCatalogs = DynamicAuthCatalogRule.FindAll(sc);

                this.PageState.Add("EntCatalogList", entCatalogs);
            }
        }
コード例 #11
0
        private void DoSelect()
        {
            string type = this.RequestData.Get("VedioType") + "";

            if (!string.IsNullOrEmpty(type))
            {
                SearchCriterion.AddSearch(Vedio.Prop_VedioType, type);
            }
            ents = Vedio.FindAll(SearchCriterion);
            this.PageState.Add("DataList", ents);
        }
コード例 #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            id = RequestData.Get <string>("id", String.Empty);
            // 类型标识
            cid   = RequestData.Get <string>("cid", String.Empty);
            type  = RequestData.Get <string>("type", String.Empty).ToLower();
            ctype = RequestData.Get <string>("ctype", "role").ToLower();

            if (!IsAsyncRequest)
            {
                cid = "2";  //WGM 13/4/7 默认组织结构
                if (!String.IsNullOrEmpty(cid))
                {
                    try
                    {
                        int icid = Convert.ToInt32(cid);

                        SearchCriterion.SetOrder("ParentID");
                        SearchCriterion.SetOrder("SortIndex");
                        SearchCriterion.SetOrder("CreateDate");
                        SearchCriterion.AddSearch("Type", icid);

                        ents = SysGroupRule.FindAll(SearchCriterion);
                    }
                    catch { }

                    this.PageState.Add("DtList", ents);
                }
                else
                {
                    SysGroupType[] typeList = SysGroupTypeRule.FindAll();
                    this.PageState.Add("DtList", typeList);
                }
            }
            else
            {
                switch (this.RequestAction)
                {
                case RequestActionEnum.Custom:
                    if (RequestActionString == "querychildren")
                    {
                        if (type == "gtype")
                        {
                            ents = SysGroup.FindAll("FROM SysGroup as ent WHERE ent.Type = ?", id);

                            this.PageState.Add("DtList", ents);
                        }
                    }
                    break;
                }
            }
        }
コード例 #13
0
        /// <summary>
        /// default
        /// </summary>
        private void DoSelect()
        {
            string PId = RequestData.Get("PId") + "";

            if (!string.IsNullOrEmpty(PId))
            {
                //ManagementInfo.Prop_PId, PId);
                SearchCriterion.AddSearch("PId", PId);
                SearchCriterion.SetOrder(ManagementInfo.Prop_CreateTime, false);
                var Ents = ManagementInfo.FindAll(SearchCriterion);
                this.PageState.Add("DataList", Ents);
            }
        }
コード例 #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            cid   = RequestData.Get <string>("cid", String.Empty);
            type  = RequestData.Get <string>("type", String.Empty).ToLower();
            ctype = RequestData.Get <string>("ctype", "role").ToLower();

            if (RequestActionString == "getData")
            {
                string filedVal = this.RequestData.Get("filedVal") + "";
                string sql      = @"select top 200 A.RoleID,A.Code,A.Description,A.Type,A.SortIndex,
                                   A.Name +' ['+ case when B.name is not null then B.Name+'/' else '' end +
                                   C.Name + ']'  AS Name
                                from Sysrole AS A
                                 left join SysGroup As B 
                                    on A.Pk_corp=B.GroupID
                                left join SysGroup As C
                                    on A.pk_deptdoc=C.GroupID
                                where A.Isabort='N' and len(A.Pk_corp)>0  and  len(A.pk_deptdoc)>0 and A.Name like '%{0}%' ";

                sql = sql.Replace("FL_PortalHR", Global.AimPortalDB);
                sql = string.Format(sql, filedVal);
                this.PageState.Add("DataList", DataHelper.QueryDictList(sql));
            }
            if (!String.IsNullOrEmpty(cid))
            {
                try
                {
                    int icid = Convert.ToInt32(cid);

                    SearchCriterion.AddSearch("Type", icid);

                    ents = SysRoleRule.FindAll(SearchCriterion);
                    this.PageState.Add("DtList", ents);
                }
                catch { }
            }
            else
            {
                string sql = @" select top 100 A.RoleID,A.Code,A.Description,A.Type,A.SortIndex,
                                    A.Name+' ['+ case when B.name is not null then B.Name+'/' else '' end +
                                    C.Name + ']'  AS Name
                                from Sysrole AS A
                                 left join SysGroup As B 
                                    on A.Pk_corp=B.GroupID
                                left join SysGroup As C
                                    on A.pk_deptdoc=C.GroupID
                                where A.Isabort='N' and len(A.Pk_corp)>0  and  len(A.pk_deptdoc)>0";
                ents = SysRoleRule.FindAll(SearchCriterion);
                this.PageState.Add("DtList", DataHelper.QueryDictList(sql));
            }
        }
コード例 #15
0
ファイル: CostCheckList.aspx.cs プロジェクト: radtek/SHHG_ERP
        private void DoSelect()
        {
            string where = "";
            string productType = RequestData.Get <string>("ProductType");

            if (!string.IsNullOrEmpty(productType))
            {
                SearchCriterion.AddSearch("ProductType", productType);
            }
            foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches)
            {
                if (item.PropertyName == "BeginDate1" && item.Value + "" != "")
                {
                    where += " and B.CreateTime>'" + item.Value + "' ";
                }
                else if (item.PropertyName == "EndDate1" && item.Value + "" != "")
                {
                    where += " and B.CreateTime<'" + (item.Value + "").Replace(" 0:00:00", " 23:59:59") + "' ";
                }
                else if (item.PropertyName == "BeginDate" && item.Value + "" != "")
                {
                    where += " and B.EndDate>'" + item.Value + "' ";
                }
                else if (item.PropertyName == "EndDate" && item.Value + "" != "")
                {
                    where += " and B.EndDate<'" + (item.Value + "").Replace(" 0:00:00", " 23:59:59") + "' ";
                }
                else if (item.Value + "" != "")
                {
                    where += " and " + item.PropertyName + " like '%" + item.Value + "%' ";
                }
            }
            string sql = @"select A.*,B.Number,B.CName,B.Salesman,B.EndDate,B.InvoiceNumber,C.ProductType,C.Pcn,C.CostPrice,
                    SHHG_AimExamine.dbo.fun_CaculateCostAmount(A.PId,A.Count,A.SalePrice) as CostAmount,                                       
                    (select top(1) Rate from SHHG_AimExamine..ExchangeRate where Symbo =(select top(1) Symbo from SHHG_AimExamine..Supplier where Id=C.SupplierId )) as Rate,
                    SHHG_AimExamine.dbo.fun_CaculateBuyPrice(A.PId) as BuyPrice, B.CreateTime
                    from (
                    select OId,PId,PCode,PName,Isbn,sum([count]) as [Count],max(SalePrice) as SalePrice, sum(Amount) as Amount from(
                    select OId,PId,PCode,PName,Isbn,([Count]-isnull(ReturnCount,0)) as Count,SalePrice,Amount from SHHG_AimExamine..OrdersPart                     
                    )t
                    group by PId,PCode,PName,Isbn,OId having sum([Count])>0
                    ) as A
                    left join SHHG_AimExamine..SaleOrders as B on A.OId=B.Id 
                    left join SHHG_AimExamine..Products as C on C.Id=A.PId 
                    where (B.DeliveryState is null or B.DeliveryState<>'已作废') and B.InvoiceType='发票' " + where;

            PageState.Add("OrderList", GetPageData(sql, SearchCriterion));
        }
コード例 #16
0
        private void ProcessDetail(IList <string> strList, StockCheck ent)
        {
            StockCheckDetail scdEnt = null;

            foreach (string str in strList)
            {
                JObject json = JsonHelper.GetObject <JObject>(str);
                scdEnt = StockCheckDetail.Find(json.Value <string>("Id"));
                if (json.Value <int>("StockCheckQuantity") >= 0)
                {
                    scdEnt.StockCheckQuantity = json.Value <int>("StockCheckQuantity");
                    if (scdEnt.StockQuantity > scdEnt.StockCheckQuantity)
                    {
                        scdEnt.StockCheckResult = "盘亏";
                    }
                    if (scdEnt.StockQuantity < scdEnt.StockCheckQuantity)
                    {
                        scdEnt.StockCheckResult = "盘赢";
                    }
                    if (scdEnt.StockQuantity == scdEnt.StockCheckQuantity)
                    {
                        scdEnt.StockCheckResult = "正常";
                        scdEnt.StockCheckState  = "盘点结束";
                    }
                    scdEnt.DoUpdate();
                }
            }
            //1  如果所有的盘点明细都正常 则把盘点单的状态改为已结束
            SearchCriterion.AddSearch("StockCheckResult", "正常", SearchModeEnum.NotEqual);
            IList <StockCheckDetail> scdEnts = StockCheckDetail.FindAll(SearchCriterion);

            if (scdEnts.Count == 0)
            {
                ent.State = "已结束"; ent.Result = "正常";
            }
            else
            {
                ent.Result = "异常";
            }
            ent.DoUpdate();
        }
コード例 #17
0
        /// <summary>
        /// 查询
        /// </summary>
        private void DoSelect()
        {
            if (!SearchCriterion.Orders.Exists(en => en.PropertyName == "CreateTime"))
            {
                SearchCriterion.Orders.Add(new OrderCriterionItem("CreateTime", false));
            }

            string paystate = RequestData.Get <string>("paystate");

            if (paystate == "1")
            {
                SearchCriterion.AddSearch("PayState", "1");
                ents = Logistic.FindAll(SearchCriterion);
            }
            else
            {
                ents = Logistic.FindAll(SearchCriterion, Expression.Sql(" isnull(PayState,0) <> '1' "));
            }

            this.PageState.Add("LogisticList", ents);
        }
コード例 #18
0
        private void DoSelect()
        {
            string where = "";
            string detailwhere = "";
            string state       = RequestData.Get <string>("State");

            if (!string.IsNullOrEmpty(state))
            {
                SearchCriterion.AddSearch("State", state);
            }
            string sql = string.Empty;

            foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches)
            {
                if (item.PropertyName == "BeginDate" && item.Value.ToString() != "")
                {
                    where += " and CreateTime>'" + item.Value + "' ";
                }
                else if (item.PropertyName == "EndDate" && item.Value.ToString() != "")
                {
                    where += " and CreateTime<'" + (item.Value.ToString()).Replace(" 0:00:00", " 23:59:59") + "' ";
                }
                else if (item.Value.ToString() != "")
                {
                    if (item.PropertyName != "ProductCode")
                    {
                        where += " and " + item.PropertyName + " like '%" + item.Value + "%'";
                    }
                    else
                    {
                        detailwhere = "where " + item.PropertyName + " like '%" + item.Value + "%'";
                    }
                }
            }
            sql = @"select A.* from SHHG_AimExamine..InWarehouse as A                
                where A.InWarehouseType !='采购入库' and A.Id in (select distinct InWarehouseId from SHHG_AimExamine..OtherInWarehouseDetail
                " + detailwhere + ")" + where;

            this.PageState.Add("InWarehouseList", GetPageData(sql, SearchCriterion));
        }
コード例 #19
0
        private void DoSelect()
        {
            string where = "";
            string detailwhere = "";
            string state       = RequestData.Get <string>("State");

            if (!string.IsNullOrEmpty(state))
            {
                SearchCriterion.AddSearch("State", state);
            }
            foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches)
            {
                if (item.PropertyName == "BeginDate" && item.Value.ToString() != "")
                {
                    where += " and CreateTime>'" + item.Value + "' ";
                }
                else if (item.PropertyName == "EndDate" && item.Value.ToString() != "")
                {
                    where += " and CreateTime<'" + (item.Value.ToString()).Replace(" 0:00:00", " 23:59:59") + "' ";
                }
                else if (item.Value.ToString() != "")
                {
                    if (item.PropertyName != "ProductCode")
                    {
                        where += " and " + item.PropertyName + " like '%" + item.Value + "%'";
                    }
                    else
                    {
                        detailwhere = "where " + item.PropertyName + " like '%" + item.Value + "%'";
                    }
                }
            }
            string sql = @"select A.*,B.MoneyType,B.Symbo  from SHHG_AimExamine..PurchaseInvoice as A 
            left join (select Id ,MoneyType,Symbo from SHHG_AimExamine..Supplier) as B on A.SupplierId=B.Id        
            where  A.Id in (select PurchaseInvoiceId from SHHG_AimExamine..PurchaseInvoiceDetail " + detailwhere + ") " + where;

            this.PageState.Add("PurchaseInvoiceList", GetPageData(sql, SearchCriterion));
        }
コード例 #20
0
ファイル: StockInfoList.aspx.cs プロジェクト: radtek/SHHG_ERP
        private void DoSelect()
        {
            string where = "";
            string productType = RequestData.Get <string>("ProductType");

            if (!string.IsNullOrEmpty(productType))
            {
                SearchCriterion.AddSearch("ProductType", productType);
            }
            string sql = string.Empty;

            foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches)
            {
                if (item.Value.ToString() != "")
                {
                    where += " and " + item.PropertyName + " like '%" + item.Value + "%'";
                }
            }
            //  ((select isnull(sum(isnull(Count,0)-isnull(OutCount,0)),0) from SHHG_AimExamine..DelieryOrderPart t where t.ProductId=A.ProductId and isnull(State,'')<>'已出库')+
            //(select isnull(sum(isnull(Count,0)-isnull(OutCount,0)),0) from SHHG_AimExamine..OrdersPart n where n.PId=A.ProductId and n.IsValid=1 and isnull(OutCount,0)<>isnull(Count,0))) as NoOutQuan,
            //SHHG_AimExamine.dbo.fun_CaculateBuyPrice(A.ProductId)*(A.StockQuantity)*(select top(1) rate from SHHG_AimExamine..ExchangeRate where Symbo=(select top(1) Symbo from SHHG_AimExamine..Supplier where Id=B.SupplierId)) as StockAmount,
            sql = @"select A.*,
            (B.BuyPrice)*(A.StockQuantity) as StockAmount,
            SHHG_AimExamine.dbo.fun_getProQuantity(A.ProductId) as StockQuan,    
            ((select isnull(sum(t.Quantity),0) from  SHHG_AimExamine..PurchaseOrderDetail t where t.ProductId=A.ProductId and t.InWarehouseState='未入库')-  
            (select isnull(sum(m.Quantity),0) from  SHHG_AimExamine..InWareHouseDetailDetail m where m.PurchaseOrderDetailId in 
            (select Id from SHHG_AimExamine..PurchaseOrderDetail t where t.ProductId=A.ProductId and t.InWarehouseState='未入库'))) as NoInQuan,
           ((select isnull(sum(isnull(Count,0)-isnull(OutCount,0)),0) from SHHG_AimExamine..DelieryOrderPart t where t.ProductId=A.ProductId and isnull(State,'')<>'已出库')+
           (select isnull(sum(isnull(Count,0)-isnull(OutCount,0)),0) from SHHG_AimExamine..OrdersPart n where n.PId=A.ProductId and n.IsValid=1 and isnull(OutCount,0)<>isnull(Count,0))) as NoOutQuan,
            SHHG_AimExamine.dbo.fun_CaculateBuyPrice(A.ProductId) as BuyPrice,          
            B.ProductType,B.MinCount,B.Pcn,B.Isbn,B.Name
            from SHHG_AimExamine..StockInfo as A 
            left join (select Id,Isbn,Pcn,MinCount,ProductType,Name,SupplierId,BuyPrice from SHHG_AimExamine..Products) as B on B.Id=A.ProductId
            where 1=1 " + where;
            PageState.Add("StockList", GetPageData(sql, SearchCriterion));
            PageState.Add("ProductTypeEnum", SysEnumeration.GetEnumDict("ProductType"));
        }
コード例 #21
0
        private void DoSelect()
        {
            string where = "";
            string productType = RequestData.Get <string>("ProductType");

            if (!string.IsNullOrEmpty(productType))
            {
                SearchCriterion.AddSearch("ProductType", productType);
            }
            string sql = string.Empty;

            foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches)
            {
                if (item.PropertyName == "BeginDate" && item.Value.ToString() != "")
                {
                    where += " and CreateTime>'" + item.Value + "' ";
                }
                else if (item.PropertyName == "EndDate" && item.Value.ToString() != "")
                {
                    where += " and CreateTime<'" + (item.Value.ToString()).Replace(" 0:00:00", " 23:59:59") + "' ";
                }
                else if (item.Value.ToString() != "")
                {
                    where += " and " + item.PropertyName + " like '%" + item.Value + "%'";
                }
            }
            sql = @"select A.Id,A.PurchaseOrderId,C.PurchaseOrderNo,A.BuyPrice,A.Quantity,A.Amount,A.PayState,A.InWarehouseState,
                A.InvoiceState,B.ProductType,B.Name,B.Code,B.Pcn,C.PriceType,C.SupplierName,C.CreateName,C.CreateTime,D.Symbo
                from (Select Id,PurchaseOrderId,BuyPrice,Quantity,Amount,
                PayState,InWarehouseState,InvoiceState,ProductId from SHHG_AimExamine..PurchaseOrderDetail) as A 
                left join (select Id,Name,Code,ProductType,Isbn,Pcn from SHHG_AimExamine..Products) as B on A.ProductId=B.Id
                left join (Select Id,PurchaseOrderNo,PriceType,SupplierId,SupplierName,CreateName,CreateTime from SHHG_AimExamine..PurchaseOrder) as C on A.PurchaseOrderId=C.Id
                left join (Select Id,Symbo from SHHG_AimExamine..Supplier) as D on D.Id=C.SupplierId
                where 1=1" + where;
            PageState.Add("DataList", GetPageData(sql, SearchCriterion));
        }
コード例 #22
0
        private void DoSelect()
        {
            if (!SearchCriterion.Orders.Exists(en => en.PropertyName == "CreateTime"))
            {
                SearchCriterion.Orders.Add(new OrderCriterionItem("CreateTime", false));
            }
            string state = "未结束";
            string temp  = RequestData.Get <string>("State");

            if (!string.IsNullOrEmpty(temp))
            {
                state = temp;
            }
            if (state == "未结束")
            {
                SearchCriterion.AddSearch("State", "已结束", SearchModeEnum.NotEqual);
            }
            else
            {
                SearchCriterion.AddSearch("State", state);
            }
            ents = StockCheck.FindAll(SearchCriterion);
            PageState.Add("DataList", ents);
        }
コード例 #23
0
        private void DoSelect()
        {
            string where = "";
            string productType = RequestData.Get <string>("ProductType");

            if (!string.IsNullOrEmpty(productType))
            {
                SearchCriterion.AddSearch("ProductType", productType);
            }
            foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches)
            {
                if (item.PropertyName == "BeginDate1" && item.Value + "" != "")
                {
                    where += " and B.CreateTime>'" + item.Value + "' ";
                }
                else if (item.PropertyName == "EndDate1" && item.Value + "" != "")
                {
                    where += " and B.CreateTime<'" + (item.Value + "").Replace(" 0:00:00", " 23:59:59") + "' ";
                }
                else if (item.PropertyName == "BeginDate" && item.Value + "" != "")
                {
                    where += " and B.EndDate>'" + item.Value + "' ";
                }
                else if (item.PropertyName == "EndDate" && item.Value + "" != "")
                {
                    where += " and B.EndDate<'" + (item.Value + "").Replace(" 0:00:00", " 23:59:59") + "' ";
                }
                else if (item.Value + "" != "")
                {
                    where += " and " + item.PropertyName + " like '%" + item.Value + "%' ";
                }
            }
            string userid = Aim.Portal.Web.WebPortalService.CurrentUserInfo.UserID;

            //2017-07-21 新增用户 f54d92c5-6b98-4120-8c5d-9b770125a0e5 沈艳霞
            if (userid == "97968039-a657-467b-b735-04dab4a9b60c" || userid == "c7712e33-2b20-463e-8910-8f234cf260ef" || userid == "46c5f4df-f6d1-4b36-96ac-d39d3dd65a5d" || userid == "7580578a-ce30-47ef-9a7e-95ca8ac97df3" || userid == "f54d92c5-6b98-4120-8c5d-9b770125a0e5")
            {
                where += "";
            }
            else
            {
                where += " and B.SalesmanId='" + userid + "'";
            }
            string sql = @"select A.*,B.Number,B.CName,B.Salesman,B.EndDate,C.ProductType,C.Pcn,C.CostPrice,C.SalePrice as BuyPrice,
                                (A.SalePrice/
                                ((isnull(C.SalePrice,1))*(select top(1) Rate from SHHG_AimExamine..ExchangeRate where Symbo =(select top(1) Symbo from SHHG_AimExamine..Supplier where Id=C.SupplierId ))))
                                as ProfitRate,
                                SHHG_AimExamine.dbo.fun_CaculateCostAmount(A.PId,A.Count,A.SalePrice) as CostAmount,
                                (select top(1) Rate from SHHG_AimExamine..ExchangeRate where Symbo =(select top(1) Symbo from SHHG_AimExamine..Supplier where Id=C.SupplierId )) as Rate,
                                B.CreateTime
                                from (
                                select OId,PId,PCode,PName,Isbn,sum(count) as Count,max(SalePrice) as SalePrice, sum(Amount) as Amount,max(CustomerOrderNo) as CustomerOrderNo from(
                                select OId,PId,PCode,PName,Isbn,(Count-isnull(ReturnCount,0)) as Count,SalePrice,Amount,CustomerOrderNo from SHHG_AimExamine..OrdersPart 
                                )t
                                group by PId,PCode,PName,Isbn,OId,isnull(CustomerOrderNo,'') having sum([Count])>0
                                ) as A
                                left join SHHG_AimExamine..SaleOrders as B on A.OId=B.Id 
                                left join SHHG_AimExamine..Products as C on C.Id=A.PId 
                                where (B.DeliveryState is null or B.DeliveryState<>'已作废') " + where;

            PageState.Add("OrderList", GetPageData(sql, SearchCriterion));
        }
コード例 #24
0
 private void DoSelect()
 {
     SearchCriterion.AddSearch("CreateId", UserInfo.UserID);
     ents = EmpInsurance.FindAll(SearchCriterion);
     PageState.Add("DataList", ents);
 }
コード例 #25
0
 /// <summary>
 /// 查询
 /// </summary>
 private void DoSelect()
 {
     SearchCriterion.AddSearch("UserId", UserInfo.UserID);
     ents = UsrHealthyWelfare.FindAll(SearchCriterion);
     this.PageState.Add("UsrHealthyWelfareList", ents);
 }
コード例 #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TypeId = RequestData.Get <string>("TypeId");

            if (!String.IsNullOrEmpty(TypeId))
            {
                ICriterion crit = null;
                if (TypeId == "Send")
                {
                    SearchCriterion.AddSearch("SenderId", this.UserInfo.UserID, SearchModeEnum.Like);
                    crit = Expression.Or(Expression.Eq("IsSenderDelete", false), Expression.IsNull("IsSenderDelete"));
                }
                else
                {
                    SearchCriterion.AddSearch("ReceiverId", this.UserInfo.UserID, SearchModeEnum.Like);
                    crit = Expression.Or(Expression.Eq("IsReceiverDelete", false), Expression.IsNull("IsReceiverDelete"));
                }

                SearchCriterion.SetOrder("SendTime", false);
                ents = SysMessageRule.FindAll(SearchCriterion, crit);

                this.PageState.Add("SysMessageList", ents);
            }

            SysMessage ent = null;

            switch (this.RequestAction)
            {
            case RequestActionEnum.Create:
                ent = this.GetPostedData <SysMessage>();
                ent.DoCreate();
                this.SetMessage("新建成功!");
                break;

            case RequestActionEnum.Update:
                ent = this.GetMergedData <SysMessage>();
                ent.DoUpdate();
                this.SetMessage("保存成功!");
                break;

            case RequestActionEnum.Delete:
                ent = this.GetTargetData <SysMessage>();
                ent.DoDelete();
                this.SetMessage("删除成功!");
                break;

            case RequestActionEnum.Custom:
                IList <object> ids = RequestData.GetList <object>("Ids");

                if (ids != null && ids.Count > 0)
                {
                    if (RequestActionString == "batchdelete")
                    {
                        SysMessage[] tents = SysMessage.FindAll(Expression.In("Id", ids.ToList()));

                        foreach (SysMessage tent in tents)
                        {
                            if (TypeId == "Send")
                            {
                                tent.IsSenderDelete = true;
                            }
                            else
                            {
                                tent.IsReceiverDelete = true;
                            }

                            tent.DoDelete();
                        }
                    }
                }
                break;
            }
        }
コード例 #27
0
        /// <summary>
        /// 查询
        /// </summary>
        private void DoSelect()
        {
            if (SearchCriterion.Orders.Count == 0)
            {
                if (!SearchCriterion.Orders.Exists(en => en.PropertyName == "CreateTime"))
                {
                    SearchCriterion.Orders.Add(new OrderCriterionItem("CreateTime", false));
                }
            }

            string type = "all";

            foreach (CommonSearchCriterionItem sear in SearchCriterion.Searches.Searches)
            {
                if (sear.PropertyName == "Name" && sear.Value + "" != "")
                {
                    type = "Logistic";
                }
                else if ((sear.PropertyName == "CName" && sear.Value + "" != "") || (sear.PropertyName == "Number" && sear.Value + "" != ""))
                {
                    type = "Order";
                }
            }

            string did = RequestData.Get <string>("did");

            if (type == "all" || type == "Logistic" || !string.IsNullOrEmpty(did))
            {
                //if (!string.IsNullOrEmpty(did))
                //{
                //    SearchCriterion.Searches.Clear();
                //}
                ents = Logistic.FindAll(SearchCriterion, Expression.Sql(" charindex('" + did + "',DeliveryId)>0 "));

                //if (ents.Count == 0 && !string.IsNullOrEmpty(did))
                //{
                //    DeliveryOrder doent = DeliveryOrder.TryFind(did);
                //    if (doent != null)
                //    {
                //        ents = Logistic.FindAll(SearchCriterion, Expression.Eq("CustomerId", doent.CId));
                //    }
                //}

                this.PageState.Add("LogisticList", ents);
            }

            if (type == "all" || type == "Order")
            {
                string     wtype = RequestData.Get <string>("wtype");
                ICriterion crit  = null;
                if (wtype == "1")
                {
                    SearchCriterion.AddSearch("LogisticState", "已填写");
                }
                else
                {
                    crit = Expression.Or(Expression.Sql(" LogisticState <> '已填写' "), Expression.IsNull("LogisticState"));
                }
                SearchCriterion.AddSearch("State", "已出库");
                DeliveryOrder[] ents2 = DeliveryOrder.FindAll(SearchCriterion, crit);
                this.PageState.Add("OrderList", ents2);

                SearchCriterion.RemoveSearch("State");
            }
        }
コード例 #28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TypeId = RequestData.Get <string>("TypeId");

            if (!String.IsNullOrEmpty(TypeId))
            {
                ICriterion crit = null;
                SearchCriterion.SetOrder("SendTime", false);
                switch (TypeId)
                {
                case "ToSend":
                    SearchCriterion.AddSearch("SenderId", this.UserInfo.UserID, SearchModeEnum.Like);
                    crit = Expression.Or(Expression.Eq("IsSenderDelete", false), Expression.IsNull("IsSenderDelete"));
                    crit = SearchHelper.IntersectCriterions(crit, Expression.IsNull(SysMessage.Prop_State));
                    ents = SysMessageRule.FindAll(SearchCriterion, crit);
                    this.PageState.Add("SysMessageList", ents);
                    break;

                case "Send":
                    SearchCriterion.AddSearch("SenderId", this.UserInfo.UserID, SearchModeEnum.Like);
                    crit = Expression.Or(Expression.Eq("IsSenderDelete", false), Expression.IsNull("IsSenderDelete"));
                    crit = SearchHelper.IntersectCriterions(crit, Expression.IsNotNull(SysMessage.Prop_State));
                    ents = SysMessageRule.FindAll(SearchCriterion, crit);
                    this.PageState.Add("SysMessageList", ents);
                    break;

                case "Receive":
                    crit = Expression.Or(Expression.Eq("IsReceiverDelete", false), Expression.IsNull("IsReceiverDelete"));
                    crit = SearchHelper.IntersectCriterions(crit, Expression.IsNull(View_SysMessage.Prop_IsFirstView), Expression.Eq(View_SysMessage.Prop_ReceiveId, this.UserInfo.UserID)
                                                            , Expression.IsNull(View_SysMessage.Prop_IsDelete));
                    View_SysMessage[] mgs = View_SysMessage.FindAll(SearchCriterion, crit);
                    this.PageState.Add("SysMessageList", mgs);
                    break;

                case "ReceiveReaded":
                    crit = Expression.Or(Expression.Eq("IsReceiverDelete", false), Expression.IsNull("IsReceiverDelete"));
                    crit = SearchHelper.IntersectCriterions(crit, Expression.IsNotNull(View_SysMessage.Prop_IsFirstView), Expression.Eq(View_SysMessage.Prop_ReceiveId, this.UserInfo.UserID)
                                                            , Expression.IsNull(View_SysMessage.Prop_IsDelete));
                    View_SysMessage[] mgss = View_SysMessage.FindAll(SearchCriterion, crit);
                    this.PageState.Add("SysMessageList", mgss);
                    break;
                }
            }

            SysMessage ent = null;

            switch (this.RequestAction)
            {
            case RequestActionEnum.Create:
                ent = this.GetPostedData <SysMessage>();
                ent.DoCreate();
                this.SetMessage("新建成功!");
                break;

            case RequestActionEnum.Update:
                ent = this.GetMergedData <SysMessage>();
                ent.DoUpdate();
                this.SetMessage("保存成功!");
                break;

            case RequestActionEnum.Delete:
                ent = this.GetTargetData <SysMessage>();
                ent.DoDelete();
                this.SetMessage("删除成功!");
                break;

            case RequestActionEnum.Custom:
                IList <object> ids = RequestData.GetList <object>("Ids");

                if (ids != null && ids.Count > 0)
                {
                    if (RequestActionString == "batchdelete")
                    {
                        if (TypeId == "Send" || TypeId == "ToSend")
                        {
                            SysMessage[] tents = SysMessage.FindAll(Expression.In("Id", ids.ToList()));

                            foreach (SysMessage tent in tents)
                            {
                                tent.IsSenderDelete = true;

                                tent.DoDelete();
                            }
                        }
                        else
                        {
                            SysMessage[] tents = SysMessage.FindAll(Expression.In("Id", ids.ToList()));

                            foreach (SysMessage tent in tents)
                            {
                                SysMessageReceive receive = SysMessageReceive.FindAllByProperties("MsgId", tent.Id, "ReceiverId", this.UserInfo.UserID)[0];
                                receive.IsDelete   = "1";
                                receive.DeleteTime = DateTime.Now;
                                receive.Save();
                            }
                        }
                    }
                }
                break;
            }
        }
コード例 #29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            id   = RequestData.Get <string>("id", String.Empty);
            type = RequestData.Get <string>("type", String.Empty).ToLower();

            switch (RequestAction)
            {
            case RequestActionEnum.Query:
            case RequestActionEnum.Read:
            case RequestActionEnum.Default:
                if (!String.IsNullOrEmpty(id))
                {
                    using (new Castle.ActiveRecord.SessionScope())
                    {
                        SearchCriterion.PageSize = 50;
                        SearchCriterion.AddSearch("AuthID", id);
                        SearchCriterion.AddSearch("CatalogCode", DynamicPermissionCatalog.SysCatalogEnum.SYS_USER.ToString());

                        dps = DynamicPermissionRule.FindAll(SearchCriterion);
                    }
                }
                break;

            case RequestActionEnum.Update:
                IList <string> entStrList = RequestData.GetList <string>("data");

                using (TransactionScope trans = new TransactionScope())
                {
                    try
                    {
                        foreach (string entStr in entStrList)
                        {
                            DynamicPermission tent = JsonHelper.GetObject <DynamicPermission>(entStr) as DynamicPermission;

                            tent.DoUpdate();
                        }

                        trans.VoteCommit();
                    }
                    catch (Exception ex)
                    {
                        trans.VoteRollBack();

                        throw ex;
                    }
                }
                break;

            case RequestActionEnum.Custom:
                if (RequestActionString == "adduser" || RequestActionString == "deluser")
                {
                    IList <string> userIDs = RequestData.GetList <string>("UserIDs");

                    if (!String.IsNullOrEmpty(id))
                    {
                        using (new SessionScope())
                        {
                            if (RequestActionString == "adduser")
                            {
                                DynamicAuth dauth = DynamicAuth.Find(id);
                                DynamicPermission.GrantDAuthToUsers(dauth, userIDs, null, null, UserInfo.UserID, UserInfo.Name);
                            }
                            else if (RequestActionString == "deluser")
                            {
                                DynamicPermission.RevokeDAuthFromUsers(id, userIDs);
                            }
                        }
                    }
                }
                break;
            }

            this.PageState.Add("EntList", dps);

            if (!IsAsyncRequest)
            {
                if (!String.IsNullOrEmpty(id))
                {
                    using (new SessionScope())
                    {
                        DynamicAuth da = DynamicAuth.Find(id);

                        DynamicAuthCatalog dac = DynamicAuthCatalog.FindFirst(Expression.Eq("Code", da.CatalogCode));

                        if (dac != null)
                        {
                            this.PageState.Add("AllowOperation", dac.GetAllowOperations());
                        }
                    }
                }

                this.PageState.Add("OpDivChar", DynamicOperations.DivChar);
            }
        }