Пример #1
0
        private void btnQuery_Click(object sender, System.EventArgs e)
        {
            //查询
            try
            {
                //this.btnInlose.Enabled = true;
                string strSql = "select "
                                + " cnvcMemberCardNo,cnvcMemberPwd,cnvcMemberName,cnvcPaperNo,cnvcCorporation, "
                                + " cnvcCompanyAddress,cnvcLinkman,cnvcLinkPhone,cnvcEmail,cnvcFax,cnvcComments,cnvcMemberRight,cnvcEnterpriseType,cnvcDiscount,cnvcFree,cnvcFree as cnvcOldFree,cnvcProduct,cnvcState,cnnMemberFee, "
                                + " cnnPrepay,cndEndDate,cnvcOperName,cndOperDate,cnvcMobileTelePhone,cnvcPostalCode,cnvcSales,cnvcHandleman,cnvcHandlemanPaperNo, "
                                + " cnvcTrade,cnvcCustomerService,cnvcCustomerService as cnvcOldCustomerService "
                                + " ,case cniSynch "
                                + " when 0 then '会员系统' "
                                + " when 1 then '网站操作' "
                                + " when 2 then '触摸屏操作'  "
                                + " when 3 then '客服预定' "
                                + " end cnvcSynch,cndInNetDate from tbMember where Len(cnvcMemberCardNo)=8 and cnvcState='" + ConstApp.Card_State_InUse + "' ";
                if (txtMemberCardNo.Text.Trim().Length > 0)
                {
                    strSql += " and cnvcMemberCardNo like '%" + txtMemberCardNo.Text + "%'";
                }
                if (txtMemberName.Text.Trim().Length > 0)
                {
                    strSql += " and cnvcMemberName like '%" + txtMemberName.Text + "%'";
                }
                if (txtPaperNo.Text.Trim().Length > 0)
                {
                    strSql += " and cnvcPaperNo like '%" + txtPaperNo.Text + "%'";
                }
//				if (cmbState.Text.Trim().Length > 0)
//				{
//					strSql += " and cnvcState = '"+cmbState.Text+"'";
//				}
                if (cmbEnterpriseType.Text.Trim().Length > 0)
                {
                    strSql += " and cnvcEnterpriseType like '%" + cmbEnterpriseType.Text + "%'";
                }
                if (cmbTrade.Text.Trim().Length > 0)
                {
                    strSql += " and cnvcTrade like '%" + cmbTrade.Text + "%'";
                }
                if (txtSales.Text.Trim().Length > 0)
                {
                    strSql += " and cnvcSales like '%" + txtSales.Text + "%'";
                }
                if (txtCustomerService.Text.Trim().Length > 0)
                {
                    strSql += " and cnvcCustomerService like '%" + txtCustomerService.Text + "%'";
                }
                if (chkEndDate.Checked)
                {
                    string strEndDate = "";
                    string aa         = cmbEndDate.Text.Trim();
                    if (DateTime.Parse(aa).Month < 10)
                    {
                        strEndDate = DateTime.Parse(aa).Year.ToString() + "-" + "0" + DateTime.Parse(aa).Month.ToString();
                    }
                    else
                    {
                        strEndDate = DateTime.Parse(aa).Year.ToString() + "-" + DateTime.Parse(aa).Month.ToString();
                    }
                    if (DateTime.Parse(aa).Day < 10)
                    {
                        strEndDate += "-" + "0" + DateTime.Parse(aa).Day.ToString();
                    }
                    else
                    {
                        strEndDate += "-" + DateTime.Parse(aa).Day.ToString();
                    }

                    strSql += " and cndEndDate < = '" + strEndDate + "' ";
                }
                if (chkBeginDate.Checked)
                {
                    strSql += " and cndInNetDate >='" + cmdBeginDate.Text + "'";
                }
                if (chkEndDate2.Checked)
                {
                    strSql += " and cndInNetDate <='" + cmbEndDate2.Text + "'";
                }
                if (cmbMemberRight.Text.Trim().Length > 0)
                {
                    strSql += " and cnvcMemberRight = '" + cmbMemberRight.Text + "'";
                }
                Query     query    = new Query();
                DataTable dtMember = query.Report(strSql);

                this.ultraGrid1.DataSource = null;
                this.ultraGrid1.DataSource = dtMember;
                this.ultraGrid1.DataBind();
                ClientHelper.AddGridColumn(this.ultraGrid1, this.oper.cnvcOperName);
                Helper.AddGridSummary(this.ultraGrid1, SummaryType.Count, "{0}", 0);
            }
            catch (BusinessException bex)
            {
                MessageBox.Show(this, bex.Message, bex.Type, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(this, ex.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #2
0
 private void btnExcel_Click(object sender, System.EventArgs e)
 {
     ClientHelper.ExportExcel(saveFileDialog1, ultraGridExcelExporter1, this.ultraGrid1, "云南人才市场会员档案报表", this.oper.cnvcOperName);
 }
Пример #3
0
        private void MemberFileQuery_Load(object sender, System.EventArgs e)
        {
//			//绑定会员状态
//			DataTable dtState = new DataTable();
//			//dtState.Columns.Add("cnvcState");
//			dtState.Columns.Add("会员状态");
//
//			DataRow drState0 = dtState.NewRow();
//			drState0["会员状态"] = ConstApp.Card_State_InUse;
//			dtState.Rows.Add(drState0);
//
//			DataRow drState1 = dtState.NewRow();
//			drState1["会员状态"] = ConstApp.Card_State_InLose;
//			dtState.Rows.Add(drState1);
//
//			DataRow drState2 = dtState.NewRow();
//			drState2["会员状态"] = ConstApp.Card_State_InAdd;
//			dtState.Rows.Add(drState2);
//
//			DataRow drState3 = dtState.NewRow();
//			drState3["会员状态"] = ConstApp.Card_State_InCallBack;
//			dtState.Rows.Add(drState3);
//			DataRow drState4 = dtState.NewRow();
//			drState4["会员状态"] = ConstApp.Card_State_NoCard;
//			dtState.Rows.Add(drState4);
//
//
//
//			cmbState.DataSource = dtState;
//			cmbState.DataBind();
            //cmbState.SelectedIndex = 0;

            ClientHelper.BindEnterpriseType(cmbEnterpriseType);
            ClientHelper.BindTrade(cmbTrade);

            cmdBeginDate.MaskInput = "yyyy-mm-dd hh:mm";
            cmbEndDate2.MaskInput  = "yyyy-mm-dd hh:mm";
            cmdBeginDate.Value     = DateTime.Now.ToString("yyyy-MM-dd") + " 00:00";
            cmbEndDate2.Value      = DateTime.Now.ToString("yyyy-MM-dd") + " 23:59";

            //cmbEndDate.MaskInput = "yyyy-mm-dd";

            this.ultraGrid1.Dock = DockStyle.Fill;
            this.ultraGrid1.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.SortMulti;
            this.ultraGroupBox2.BorderStyle = Infragistics.Win.Misc.GroupBoxBorderStyle.None;
            this.ultraGroupBox2.BringToFront();

            ClientHelper.BindMemberRight(cmbMemberRight);
            PopulateValueList();

//			if (ClientHelper.idept.cnnDeptID != 0)
//			{
//				if(!Login.constApp.alOperFunc.Contains("会员档案报表查询"))
//				{
//					this.btnQuery.Enabled = false;
//				}
//				if(!Login.constApp.alOperFunc.Contains("会员档案报表打印"))
//				{
//					this.btnPrint.Enabled = false;
//					this.btnExcel.Enabled = false;
//				}
//				if(!Login.constApp.alOperFunc.Contains("会员档案报表修改"))
//				{
//					//this.btnPrint.Enabled = false;
//					this.btnModify.Enabled = false;
//				}
//			}
        }