Exemple #1
0
        public IList GetAuthConfigByOperationJobID(string sOperationJobID, string sRootMenuCode)
        {
            IList       lstAuthConfig = null;
            Menus       oRootMenus    = GetMenus(sRootMenuCode);
            ObjectQuery oq            = new ObjectQuery();

            if (!string.IsNullOrEmpty(sOperationJobID))
            {
                List <string> roleIdLst = GetRoleIdByJobId(sOperationJobID);
                if (roleIdLst == null || roleIdLst.Count == 0)
                {
                    return(new ArrayList());
                }

                Disjunction dis = Expression.Disjunction();
                foreach (string id in roleIdLst)
                {
                    dis.Add(Expression.Eq("Roles.Id", id));
                }
                oq.AddCriterion(dis);
            }
            string IdCode = oRootMenus == null ? "%" : oRootMenus.Id + "%";

            oq.AddCriterion(Expression.Like("Menus.IdCode", IdCode));
            oq.AddOrder(Order.Asc("Menus.Level"));
            oq.AddOrder(Order.Asc("Menus.Serial"));
            lstAuthConfig = GetAuthConfig(oq);

            return(lstAuthConfig);
        }
Exemple #2
0
        public IList GetPersonOnJob(string sUserCode)
        {
            ObjectQuery oQuery = new ObjectQuery();

            oQuery.AddCriterion(Expression.Eq("StandardPerson.Code", sUserCode));
            oQuery.AddCriterion(Expression.Eq("State", 1));
            oQuery.AddFetchMode("OperationJob", FetchMode.Eager);
            //oQuery.AddFetchMode("StandardPerson", FetchMode.Eager);
            oQuery.AddFetchMode("OperationJob.OperationOrg", FetchMode.Eager);
            IList lstResult = dao.ObjectQuery(typeof(PersonOnJob), oQuery);

            return(lstResult);
        }
Exemple #3
0
    public void InitalData()
    {
        ObjectQuery oq = new ObjectQuery();

        oq.AddCriterion(Expression.Eq("BusinessFlag", "01"));//获取收款类别的会计科目
        IList acctTitleList   = GlobalClass.AccountTitleTreeSvr.GetAccountTitleTreeByQuery(oq);
        IList otherGatherList = new ArrayList();

        foreach (AccountTitleTree title in acctTitleList)
        {
            if (title.Code == "112201" || title.Code == "112206")
            {
                // gathingAcctTitle = title;
            }
            else
            {
                otherGatherList.Add(title);
            }
        }
        otherGatherList.Insert(0, new AccountTitleTree());
        cmbGatheringType.DataSource     = otherGatherList;
        cmbGatheringType.DataTextField  = "Name";
        cmbGatheringType.DataValueField = "Id";
        cmbGatheringType.DataBind();
    }
Exemple #4
0
    public void InitalData()
    {
        ObjectQuery oq = new ObjectQuery();

        oq.AddCriterion(Expression.Eq("BusinessFlag", "02"));
        IList acctTitleList    = GlobalClass.AccountTitleTreeSvr.GetAccountTitleTreeByQuery(oq);
        IList otherPaymentList = new ArrayList();

        foreach (AccountTitleTree title in acctTitleList)
        {
            if (title.Code == "220202" || title.Code == "220203" || title.Code == "220204" || title.Code == "220205" || title.Code == "220299" ||
                title.Code == "22020801" || title.Code == "22020802" || title.Code == "22020803" || title.Code == "22020804")
            {
                //paymentAcctTitle = title;
            }
            else
            {
                otherPaymentList.Add(title);
            }
        }
        otherPaymentList.Insert(0, new AccountTitleTree());
        this.cmbPaymentType.DataSource = otherPaymentList;
        cmbPaymentType.DataTextField   = "Name";
        cmbPaymentType.DataValueField  = "Id";
        this.cmbPaymentType.DataBind();
    }
        public CompanyInfo SavePlaceTreeRootNode()
        {
            ObjectQuery oqTree = new ObjectQuery();

            oqTree.AddCriterion(Expression.Eq("Name", "公司管理"));
            IList listTree = dao.ObjectQuery(typeof(CategoryTree), oqTree);

            CategoryTree tree = null;

            if (listTree.Count > 0)
            {
                tree = listTree[0] as CategoryTree;
            }

            CompanyInfo oCompanyInfo = new CompanyInfo();

            oCompanyInfo.Name             = "公司信息";
            oCompanyInfo.ParentNode       = null;
            oCompanyInfo.CategoryNodeType = VirtualMachine.Patterns.CategoryTreePattern.Domain.NodeType.RootNode;
            oCompanyInfo.CreateDate       = DateTime.Now;
            oCompanyInfo.Level            = 1;
            oCompanyInfo.OrderNo          = 1;
            oCompanyInfo.State            = 1;
            oCompanyInfo.TheTree          = tree;
            oCompanyInfo.Author           = Dao.Get(typeof(BusinessOperators), "428") as IBusinessOperators;
            dao.Save(oCompanyInfo);
            oCompanyInfo.SysCode = oCompanyInfo.Id + ".";
            dao.Update(oCompanyInfo);
            return(oCompanyInfo);
        }
Exemple #6
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         string[]    idlst = txtIdListHidden.Value.Split(new char[] { '|' });
         ObjectQuery oq    = new ObjectQuery();
         Disjunction dis   = new Disjunction();
         foreach (string id in idlst)
         {
             dis.Add(Expression.Eq("Id", id));
         }
         oq.AddCriterion(dis);
         IList <PaymentOrderDetial> list = model.QueryDetial(oq);
         if (model.Delete(list as IList))
         {
             UtilClass.MessageBox(this, "删除成功!");
             GridViewSource1.GetData();
             SumMoney();
             Clear();
         }
         else
         {
             UtilClass.MessageBox(this, "删除失败!");
         }
     }
     catch (Exception)
     {
         UtilClass.MessageBox(this, "操作失误,请重试!");
     }
 }
Exemple #7
0
    protected void btnQuery_Click(object sender, EventArgs e)
    {
        ObjectQuery oq               = new ObjectQuery();
        string      projectName      = txtProjectName.Value.Trim();
        string      projectType      = selProjectType.Value;
        string      projectInfoState = selProjectState.Value;
        string      projectStage     = selProjectStage.Value;

        if (projectName == "" && projectType == "" && projectInfoState == "" && projectStage == "")
        {
            MessageBox("请至少输入一个查询条件!");
            txtProjectName.Focus();
            return;
        }

        if (!string.IsNullOrEmpty(projectName))
        {
            oq.AddCriterion(Expression.Like("Name", projectName, MatchMode.Anywhere));
        }

        if (!string.IsNullOrEmpty(projectType))
        {
            oq.AddCriterion(Expression.Eq("ProjectType", (int)VirtualMachine.Component.Util.EnumUtil <EnumProjectType> .FromDescription(projectType)));
        }

        if (!string.IsNullOrEmpty(projectInfoState))
        {
            oq.AddCriterion(Expression.Eq("ProjectInfoState", VirtualMachine.Component.Util.EnumUtil <EnumProjectInfoState> .FromDescription(projectInfoState)));
        }

        if (!string.IsNullOrEmpty(projectStage))
        {
            oq.AddCriterion(Expression.Eq("ProjectLifeCycle", VirtualMachine.Component.Util.EnumUtil <EnumProjectLifeCycle> .FromDescription(projectStage)));
        }

        list = MGWBS.GWBSSrv.QueryProjectWarnInfo(oq);
        List <CurrentProjectInfo> listProject = new List <CurrentProjectInfo>();

        foreach (CurrentProjectInfo p in list.Keys)
        {
            listProject.Add(p);
        }
        gridProject.DataSource = listProject;
        gridProject.DataBind();
    }
Exemple #8
0
        public Menus GetMenus(string sCode)
        {
            ObjectQuery oQuery = new ObjectQuery();

            oQuery.AddCriterion(Expression.Eq("Code", sCode));
            IList lstMenus = dao.ObjectQuery(typeof(Menus), oQuery);

            return(lstMenus == null || lstMenus.Count == 0 ? null : lstMenus[0] as Menus);
        }
Exemple #9
0
    public AuthRole GetAuthRoleByRoleID(string sRoleID)
    {
        ObjectQuery oQuery = new ObjectQuery();

        oQuery.AddCriterion(Expression.Eq("Id", sRoleID));
        IList lst = AuthSvr.AuthConfigSrv.GetAuthRole(oQuery);

        return(lst == null || lst.Count == 0 ? null : lst[0] as AuthRole);
    }
Exemple #10
0
    public Menus GetMenusById(string strID)
    {
        ObjectQuery oQuery = new ObjectQuery();

        oQuery.AddCriterion(Expression.Eq("Id", strID));
        IList lstMenus = AuthSvr.MenusSrv.GetObjects(typeof(Menus), oQuery);

        return(lstMenus != null && lstMenus.Count > 0 ? lstMenus[0] as Menus : null);
    }
Exemple #11
0
        public object QueryById(Type type, string sID)
        {
            ObjectQuery oQuery = new ObjectQuery();

            oQuery.AddCriterion(Expression.Eq("Id", sID));
            IList lst = dao.ObjectQuery(type, oQuery);

            return(lst == null || lst.Count == 0 ? null : lst[0]);
        }
        public PaymentOrderDetial GetPaymentOrderDetailById(string strID)
        {
            ObjectQuery oQuery = new ObjectQuery();

            oQuery.AddCriterion(Expression.Eq("Id", strID));
            oQuery.AddFetchMode("Master", NHibernate.FetchMode.Eager);
            IList lst = dao.ObjectQuery(typeof(PaymentOrderDetial), oQuery);

            return(lst == null || lst.Count == 0 ? null : lst[0] as PaymentOrderDetial);
        }
        public CompanyInfo GetCompanyInfoById(string strID)
        {
            ObjectQuery oQuery = new ObjectQuery();

            oQuery.AddCriterion(Expression.Eq("Id", strID));
            oQuery.AddFetchMode("PersonMng", NHibernate.FetchMode.Eager);
            IList lst = dao.ObjectQuery(typeof(CompanyInfo), oQuery);

            return(lst == null || lst.Count == 0? null : lst[0] as CompanyInfo);
        }
Exemple #14
0
        public IList GetPersonOnJob(string sUserCode, string sPassWord, string sOperationJobId)
        {
            PersonOnJob o;

            ObjectQuery oQuery        = new ObjectQuery();
            string      sTempPassWord = string.Empty;

            if (string.IsNullOrEmpty(sPassWord))
            {
                sPassWord = "";
            }
            sTempPassWord = CryptoString.Encrypt(sPassWord, sPassWord);
            //oQuery.AddCriterion(Expression.Eq("StandardPerson.Password", sPassWord));
            oQuery.AddCriterion(Expression.Eq("StandardPerson.Code", sUserCode));
            oQuery.AddCriterion(Expression.Eq("OperationJob.Id", sOperationJobId));
            oQuery.AddCriterion(Expression.Eq("State", 1));
            oQuery.AddFetchMode("OperationJob", FetchMode.Eager);
            oQuery.AddFetchMode("StandardPerson", FetchMode.Eager);
            oQuery.AddFetchMode("OperationJob.OperationOrg", FetchMode.Eager);
            IList lstResult = dao.ObjectQuery(typeof(PersonOnJob), oQuery);

            for (int i = lstResult.Count - 1; i > -1; i--)
            {
                PersonOnJob oPersonOnJob = lstResult[i] as PersonOnJob;
                if (oPersonOnJob.StandardPerson != null)
                {
                    if (string.Equals(oPersonOnJob.StandardPerson.Password, sTempPassWord) || string.Equals(oPersonOnJob.StandardPerson.Password, sPassWord))
                    {
                        continue;
                    }
                    else if (string.IsNullOrEmpty(oPersonOnJob.StandardPerson.Password) && string.IsNullOrEmpty(sTempPassWord))
                    {
                        continue;
                    }
                    else
                    {
                        lstResult.RemoveAt(i);
                    }
                }
            }
            return(lstResult);
        }
Exemple #15
0
        public IList GetAuthConfigByMenuIDCode(string sRootMenuCode)
        {
            IList       lstAuthConfig = null;
            Menus       oRootMenus    = GetMenus(sRootMenuCode);
            ObjectQuery oq            = new ObjectQuery();
            string      IdCode        = oRootMenus == null ? "%" : oRootMenus.Id + "%";

            oq.AddCriterion(Expression.Like("Menus.IdCode", IdCode));
            lstAuthConfig = GetAuthConfig(oq);
            return(lstAuthConfig);
        }
        public PaymentOrderMaster GetPaymentOrderById(string strId)
        {
            //PaymentOrderMaster oPaymentOrderMaster;
            ObjectQuery oQuery = new ObjectQuery();

            oQuery.AddCriterion(Expression.Eq("Id", strId));
            oQuery.AddFetchMode("Payee", NHibernate.FetchMode.Eager);
            oQuery.AddFetchMode("Details", NHibernate.FetchMode.Eager);
            IList <PaymentOrderMaster> lst = Query(oQuery);

            return((lst != null && lst.Count > 0) ? lst[0]  : null);
        }
Exemple #17
0
        public IList GetAdminMenus(string sRootMenuCode)
        {
            IList       lstMenu    = null;
            Menus       oRootMenus = GetMenus(sRootMenuCode);
            ObjectQuery oq         = new ObjectQuery();
            string      IdCode     = oRootMenus == null ? "%" : oRootMenus.Id + "%";

            oq.AddCriterion(Expression.Like("IdCode", IdCode));
            oq.AddOrder(Order.Asc("Level"));
            oq.AddOrder(Order.Asc("Serial"));
            lstMenu = dao.ObjectQuery(typeof(Menus), oq);
            return(lstMenu);
        }
Exemple #18
0
    public SessionInfo(string sUserCode, string sPassWord, string sJobID)
    {
        ObjectQuery oQuery = new ObjectQuery();

        oQuery.AddCriterion(Expression.Eq("StandardPerson.Code", sUserCode));
        oQuery.AddCriterion(Expression.Eq("StandardPerson.Password", sPassWord));
        oQuery.AddCriterion(Expression.Eq("OperationJob.Id", sJobID));
        //oQuery.AddFetchMode("OperationJob", FetchMode.Eager);
        //oQuery.AddFetchMode("OperationJob.OperationOrg", FetchMode.Eager);
        //oQuery.AddFetchMode("StandardPerson", FetchMode.Eager);
        IList lstPersonOnJob = ResourceSvr.PersonOnJobManager.GetOnJobPersonList(oQuery);

        if (lstPersonOnJob != null && lstPersonOnJob.Count > 0)
        {
            PersonOnJob oPersonOnJob = lstPersonOnJob[0] as PersonOnJob;

            this.oCurrentPerson = oPersonOnJob.StandardPerson;
            this.oCurrentJob    = oPersonOnJob.OperationJob;
            this.oCurrentOrg    = oPersonOnJob.OperationJob.OperationOrg;
        }
        else
        {
        }
    }
Exemple #19
0
    public IList GetCheckMenus()
    {
        IList lstMenuIDs = this.GetCheckedMenuIDs();
        IList lstMenu    = null;

        if (lstMenuIDs != null && lstMenuIDs.Count > 0)
        {
            ObjectQuery oQuery = new ObjectQuery();
            oQuery.AddCriterion(Expression.In("Id", lstMenuIDs));
            lstMenu = AuthSvr.AuthConfigSrv.GetMenus(oQuery);
        }
        else
        {
        }
        return(lstMenu);
    }
Exemple #20
0
    private void BindChart1Data()
    {
        ObjectQuery oq = new ObjectQuery();

        oq.AddCriterion(Expression.Eq("OwnerOrg.Id", ProjectId));
        IList listProject = MGWBS.GWBSSrv.ObjectQuery(typeof(CurrentProjectInfo), oq);
        CurrentProjectInfo projectInfo = null;

        if (listProject.Count > 0)
        {
            projectInfo = listProject[0] as CurrentProjectInfo;

            LoadProject(projectInfo);

            LoasdOrder(projectInfo);
        }
    }
Exemple #21
0
    protected void btnSure_Click(object sender, EventArgs e)
    {
        string sIDs    = this.hdPersonID.Value.Trim();
        string sMethod = this.hdSelectMethod.Value;
        string sJosn   = string.Empty;

        string[]    arrIDs = sIDs.Split(',');
        ObjectQuery oQuery = new ObjectQuery();

        oQuery.AddCriterion(Expression.In("Id", arrIDs));
        IList lst = ResourceSvr.PersonManager.GetPerson(typeof(StandardPerson), oQuery);

        sJosn             = UtilClass.ObjectToJson(lst);
        this.hdJosn.Value = string.IsNullOrEmpty(sJosn) ? string.Empty : sJosn;
        UtilClass.ExecuteScript(this, "Sure();");
        //string sMsg = string.Format(" <script>  Close(\"{0}\"); </script> ", this.hdJosn.Value);
        //Page.ClientScript.RegisterStartupScript(this.GetType(), "232", sMsg);
    }
Exemple #22
0
    public bool DeleteConfig(IList lstMenus)
    {
        bool  bFlag  = false;
        IList lstIDs = GetMenuIDs(lstMenus);

        if (lstIDs != null && lstIDs.Count > 0)
        {
            ObjectQuery oQuery = new ObjectQuery();
            oQuery.AddCriterion(Expression.In("Menus.Id", lstIDs));
            IList lstAuthConfig = AuthSvr.MenusSrv.GetObjects(typeof(AuthConfig), oQuery);
            if (lstAuthConfig != null && lstAuthConfig.Count > 0)
            {
                AuthSvr.MenusSrv.Delete(lstAuthConfig);
                bFlag = true;
            }
        }
        return(bFlag);
    }
        public bool DeleteCompanyInfoByID(string sID)
        {
            bool        bFlag        = false;
            CompanyInfo oCompanyInfo = dao.Get(typeof(CompanyInfo), sID) as CompanyInfo;

            if (oCompanyInfo != null)
            {
                ObjectQuery oQuery = new ObjectQuery();
                oQuery.AddCriterion(Expression.Like("SysCode", oCompanyInfo.SysCode, MatchMode.Start));
                IList lst = dao.ObjectQuery(typeof(CompanyInfo), oQuery);
                if (lst != null && lst.Count > 0)
                {
                    dao.Delete(lst);
                    bFlag = true;
                }
            }
            return(bFlag);
        }
Exemple #24
0
    public void ViewToModel()
    {
        if (ValidateData())
        {
            #region 主表
            CurMaster.CreateDate = ClientUtil.ToDateTime(txtCreateDate.Text);
            CurMaster.Descript   = ClientUtil.ToString(this.txtRemark.Text);

            // CurMaster.BankAddress = ClientUtil.ToString(this.hdBankAddress.Value);
            CurMaster.IfProjectMoney = PaymentType;
            if (!string.IsNullOrEmpty(this.hdSupplyID.Value))
            {
                ObjectQuery oQuery = new ObjectQuery();
                oQuery.AddCriterion(Expression.Eq("Id", this.hdSupplyID.Value));
                IList lst = GlobalClass.CommonMethodSrv.Query(typeof(SupplierRelationInfo), oQuery);
                SupplierRelationInfo oTheSupplierRelationInfo = (lst != null && lst.Count > 0) ? (lst[0] as SupplierRelationInfo):null;

                CurMaster.TheSupplierRelationInfo = oTheSupplierRelationInfo == null?"":oTheSupplierRelationInfo.Id;
                CurMaster.BankAccountNo           = oTheSupplierRelationInfo == null ? "" : oTheSupplierRelationInfo.BankAccount;
                CurMaster.BankName = oTheSupplierRelationInfo == null?"":oTheSupplierRelationInfo.BankName;
                //CurMaster.BankAddress=CurMaster.TheSupplierRelationInfo.
            }
            CurMaster.BankAccountNo   = ClientUtil.ToString(this.txtBankAcctNo.Text);
            CurMaster.BankName        = ClientUtil.ToString(this.txtBankNo.Text);
            CurMaster.TheSupplierName = txtSupply.Text;


            if (!string.IsNullOrEmpty(cmbPaymentType.SelectedValue))
            {
                AccountTitleTree currAccountTitle = GetAccountTitleTree(cmbPaymentType.SelectedValue);
                CurMaster.AccountTitleID      = currAccountTitle == null ? "" : currAccountTitle.Id;
                CurMaster.AccountTitleName    = currAccountTitle == null ? "" : currAccountTitle.Name;
                CurMaster.AccountTitleCode    = currAccountTitle == null ? "" : currAccountTitle.Code;
                CurMaster.AccountTitleSyscode = currAccountTitle == null ? "" : currAccountTitle.SysCode;
            }

            #endregion
            #region 明细
            //this.gvDetail.DataSource = this.CurMaster.Details;
            //this.gvDetail.DataBind();

            #endregion
        }
    }
Exemple #25
0
    public IList GetSelectMenus()
    {
        IList lstMenuIDs = new ArrayList();
        IList lstMenu    = null;

        if (this.trvMenu.SelectedNode != null)
        {
            GetMenuID(this.trvMenu.SelectedNode, lstMenuIDs);
        }

        if (lstMenuIDs != null && lstMenuIDs.Count > 0)
        {
            ObjectQuery oQuery = new ObjectQuery();
            oQuery.AddCriterion(Expression.In("Id", lstMenuIDs));

            lstMenu = AuthSvr.AuthConfigSrv.GetMenus(oQuery);
        }
        return(lstMenu);
    }
Exemple #26
0
        /// <summary>
        /// 查找项目信息
        /// </summary>
        /// <param name="ownerorgsyscode">组织层次码</param>
        /// <returns></returns>
        public CurrentProjectInfo GetProjectInfo(string ownerorgsyscode)
        {
            ObjectQuery oq = new ObjectQuery();

            oq.AddCriterion(Expression.Sql(" instr('" + ownerorgsyscode + "',{alias}.ownerorgsyscode)>0"));
            IList lst = Dao.ObjectQuery(typeof(CurrentProjectInfo), oq);

            if (lst != null && lst.Count > 0)
            {
                foreach (CurrentProjectInfo projectInfo in lst)
                {
                    if (projectInfo.Code != "0000")
                    {
                        return(projectInfo);
                    }
                }
            }
            return(null);
        }
Exemple #27
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         string[]    idlst = txtIdListHidden.Value.Split(new char[] { '|' });
         ObjectQuery oq    = new ObjectQuery();
         Disjunction dis   = new Disjunction();
         foreach (string id in idlst)
         {
             dis.Add(Expression.Eq("Id", id));
         }
         oq.AddCriterion(dis);
         oq.AddFetchMode("Details", NHibernate.FetchMode.Eager);
         IList <PaymentOrderMaster> list = model.Query(oq);
         foreach (PaymentOrderMaster master in list)
         {
             if (master.DocState != DocumentState.Edit)
             {
                 UtilClass.MessageBox(this, "该单据已提交,不能重复提交!");
                 return;
             }
             if (master.Details.Count == 0)
             {
                 UtilClass.MessageBox(this, "该单据没有明细,不能提交!");
                 return;
             }
             master.DocState = DocumentState.InExecute;
         }
         if (model.SaveOrUpdate(list))
         {
             UtilClass.MessageBox(this, "提交成功");
             GridViewSource1.GetData();
         }
     }
     catch (Exception ex)
     {
         UtilClass.MessageBox(this, "操作失败!" + ex.Message);
     }
 }
Exemple #28
0
    public void ViewToModel()
    {
        if (ValidateData())
        {
            #region 主表
            // this.CurMaster.Code = this.txtCode.Text;

            // this.CurMaster.Descript = this.txtDescript.Text;
            this.CurMaster.CreateDate = UtilClass.ToDateTime(this.txtCreateDate.Text);
            this.CurMaster.Descript   = this.txtRemark.Text;
            CurMaster.IfProjectMoney  = GatheringType;
            //单位选择
            if (!string.IsNullOrEmpty(this.hdTheCustomerID.Value))
            {
                ObjectQuery oQuery = new ObjectQuery();
                oQuery.AddCriterion(Expression.Eq("Id", this.hdTheCustomerID.Value));
                IList lst = GlobalClass.CommonMethodSrv.Query(typeof(CustomerRelationInfo), oQuery);
                CurMaster.TheCustomerRelationInfo = (lst != null && lst.Count > 0) ? (lst[0] as CustomerRelationInfo).Id : null;
                //CurMaster.TheCustomerName = txtTheCustomerName.Text;
            }

            CurMaster.TheCustomerName = txtTheCustomerName.Text;

            AccountTitleTree currAccountTitle = string.IsNullOrEmpty(this.cmbGatheringType.SelectedValue) ? null : GetAccountTitleTree(this.cmbGatheringType.SelectedValue);
            CurMaster.AccountTitleID      = currAccountTitle == null?"": currAccountTitle.Id;
            CurMaster.AccountTitleName    = currAccountTitle == null ? "" : currAccountTitle.Name;
            CurMaster.AccountTitleCode    = currAccountTitle == null ? "" : currAccountTitle.Code;
            CurMaster.AccountTitleSyscode = currAccountTitle == null ? "" : currAccountTitle.SysCode;
            #endregion
            #region 明细
            //this.gvDetail.DataSource = this.CurMaster.Details;
            //this.gvDetail.DataBind();

            #endregion
        }
    }
Exemple #29
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         string[]    idlst = txtIdListHidden.Value.Split(new char[] { '|' });
         ObjectQuery oq    = new ObjectQuery();
         Disjunction dis   = new Disjunction();
         foreach (string id in idlst)
         {
             dis.Add(Expression.Eq("Id", id));
         }
         oq.AddCriterion(dis);
         IList <PaymentOrderMaster> list = model.Query(oq);
         foreach (PaymentOrderMaster master in list)
         {
             if (master.DocState != DocumentState.Edit)
             {
                 UtilClass.MessageBox(this, "该单据已提交,不能删除!");
                 return;
             }
         }
         if (model.Delete(list))
         {
             UtilClass.MessageBox(this, "删除成功!");
             GridViewSource1.GetData();
         }
         else
         {
             UtilClass.MessageBox(this, "删除失败!");
         }
     }
     catch (Exception)
     {
         UtilClass.MessageBox(this, "操作失误,请重试!");
     }
 }
Exemple #30
0
    private void LoadOperationOrgTree()
    {
        Hashtable hashtable = new Hashtable();

        try
        {
            NavigateTree.Nodes.Clear();

            //机构类型 h 总公司;hd 总公司部门;b 分公司;bd 分公司部门;zgxmb 直管项目部;fgsxmb 分公司项目部

            ObjectQuery oq = new ObjectQuery();
            oq.AddCriterion(Expression.Eq("State", 1));

            Disjunction dis = new Disjunction();
            dis.Add(Expression.Eq("OperationType", "h"));
            dis.Add(Expression.Eq("OperationType", "b"));
            dis.Add(Expression.Eq("OperationType", "zgxmb"));
            dis.Add(Expression.Eq("OperationType", "fgsxmb"));
            //dis.Add(Expression.Eq("CategoryNodeType", VirtualMachine.Patterns.CategoryTreePattern.Domain.NodeType.RootNode));
            oq.AddCriterion(dis);

            oq.AddOrder(Order.Asc("Level"));
            oq.AddOrder(Order.Asc("OrderNo"));
            IList list = MGWBS.GWBSSrv.ObjectQuery(typeof(OperationOrg), oq);

            foreach (OperationOrg childNode in list)
            {
                if (childNode.State == 0)
                {
                    continue;
                }

                TreeNode tnTmp = new TreeNode();
                tnTmp.Text        = childNode.Name;
                tnTmp.Value       = childNode.Id;
                tnTmp.NavigateUrl = "/IRPWebClient/map/BaiduMap.aspx?ProjectId=" + childNode.Id + "&ProjectName=" + HttpUtility.UrlEncode(childNode.Name) + "&ProjectType=" + childNode.OperationType;

                if (childNode.Level == 2 && childNode.OperationType.ToLower() == "h")
                {
                    NavigateTree.Nodes.Add(tnTmp);
                    txtProjectId.Value = "ProjectId=" + childNode.Id;
                }
                else
                {
                    TreeNode tnp = null;
                    tnp = hashtable[childNode.ParentNode.Id.ToString()] as TreeNode;
                    if (tnp != null)
                    {
                        tnp.ChildNodes.Add(tnTmp);
                    }
                }
                hashtable.Add(tnTmp.Value, tnTmp);
            }
            if (list.Count > 0)
            {
                //this.NavigateTree.Nodes[0].Select();
                //this.tvwCategory.Nodes[0].Expand();
            }
        }
        catch (Exception e)
        {
            Response.Write("<script type='text/javascript'>alert('" + ExceptionUtil.ExceptionMessage(e) + "');</script>");
        }
    }