Example #1
0
        private void btn_Statistics_Click(object sender, EventArgs e)
        {
            tbc_Statistics.Visible = true;
            tabc_Mian.Visible = false;
            tabc_SystemManager.Visible = false;
            uC_Page_Statistics_Member.tp.CurrentPage = 1;
            dtp_Statistics_Member_StartTime.Text = DateTime.Now.AddDays(-1).ToString();
            GetStatisticsMemberList();
            List<CardTypeInfoModel> cardTypeInfoList = cardTypeManager.GetModelList(" 1=1");
            if (cardTypeInfoList != null)
            {
                CardTypeInfoModel model = new CardTypeInfoModel();
                model.CardTypeName = "全部";
                model.CardTypeID = 0;
                cardTypeInfoList.Add(model);

                cmb_Statistics_Member_Type.DataSource = cardTypeInfoList;
                cmb_Statistics_Member_Type.DisplayMember = "CardTypeName";
                cmb_Statistics_Member_Type.ValueMember = "CardTypeID";
                cmb_Statistics_Member_Type.SelectedIndex = 0;
            }
            cmb_Statistics_Member_Type.SelectedIndex = cardTypeInfoList.Count - 1;
        }
 private void btn_OK_Click(object sender, EventArgs e)
 {
     errorProvider1.Clear();
     if (txt_CardTypeName.Text.Trim() == "")
     {
         errorProvider1.SetError(txt_CardTypeName, "请输入产品名称!");
         return;
     }
     if (manager.GetModelList(" CardTypeName='" + txt_CardTypeName.Text.Trim() + "' and CardTypeID <> " + cardTypeid + "").Count > 0)
     {
         errorProvider1.SetError(txt_CardTypeName, "产品名称已存在,请更换!");
         return;
     }
     if (txt_Price.Text.Trim() == "")
     {
         errorProvider1.SetError(txt_Price, "请输入产品价格!");
         return;
     }
     try
     {
         Convert.ToInt32(txt_Price.Text.Trim());
     }
     catch (Exception ex)
     {
         errorProvider1.SetError(txt_Price, "价格输入错误,请重新输入!");
         return;
     }
     try
     {
         Convert.ToInt32(txt_DayPrice.Text.Trim());
     }
     catch (Exception ex)
     {
         errorProvider1.SetError(txt_DayPrice, "价格输入错误,请重新输入!");
         return;
     }
     if (cmb_TypeName.Text.Contains("次"))
     {
         if (txt_CardCount.Text.Trim() == "")
         {
             errorProvider1.SetError(txt_CardCount, "请输入使用次数!");
             return;
         }
         try
         {
             Convert.ToInt32(txt_CardCount.Text.Trim());
         }
         catch (Exception ex)
         {
             errorProvider1.SetError(txt_CardCount, "使用次数输入错误,请重新输入!");
             return;
         }
     }
     if (txt_DayPrice.Text.Trim() == "")
     {
         errorProvider1.SetError(txt_DayPrice, "请输入单日价格!");
         return;
     }
     if (txt_Months.Text.Trim() == "")
     {
         errorProvider1.SetError(txt_Months, "请输入产品有效期!");
         return;
     }
     try
     {
         Convert.ToInt32(txt_Months.Text.Trim());
     }
     catch (Exception ex)
     {
         errorProvider1.SetError(txt_Months, "产品有效期输入错误,请重新输入!");
         return;
     }
     CardTypeInfoModel model = new CardTypeInfoModel();
     model.CardTypeID =cardTypeid;
     model.CardTypeName = txt_CardTypeName.Text.Trim();
     model.TypeName = cmb_TypeName.Text.Trim();
     model.Months = txt_Months.Text.Trim();
     model.MonthsPrice = txt_Price.Text.Trim();
     model.DayPrice = txt_DayPrice.Text.Trim();
     model.CardCount = txt_CardCount.Text.Trim();
     model.DateTime = CommTools.GetDateFormatStrot2(DateTime.Now);
     bool isAdd = manager.Update(model);
     MessageBox.Show("消费型产品:" + txt_CardTypeName.Text.Trim() + " 修改" + (isAdd == true ? "成功!" : "失败!"));
     CommTools.AddSystemLog("修改", "消费型产品:" + txt_CardTypeName.Text.Trim() + " 修改" + (isAdd == true ? "成功!" : "失败!"));
     MainForm mf = (MainForm)this.Owner;
     mf.GetCardTypeDataList();
     this.Close();
 }
Example #3
0
        private void tbc_Statistics_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (tbc_Statistics.SelectedIndex == 0)
            {

            }
            if (tbc_Statistics.SelectedIndex == 1)
            {
                dtp_Statistics_SellCast_StartTime.Text = DateTime.Now.AddDays(-1).ToString();
                cmb_Statistics_SellCast_Type.SelectedIndex = 0;
                uC_Page_Statistics_SellCast.tp.CurrentPage = 1;
                List<CunsumeTypeModel> cardTypeInfoList = cunsumeTypeManager.GetModelList(" 1=1");
                if (cardTypeInfoList != null)
                {
                    CunsumeTypeModel model = new CunsumeTypeModel();
                    model.CusType = "全部";
                    model.Id = 0;
                    cardTypeInfoList.Add(model);

                    cmb_CusType.DataSource = cardTypeInfoList;
                    cmb_CusType.DisplayMember = "CusType";
                    cmb_CusType.ValueMember = "Id";
                    cmb_CusType.SelectedIndex = 0;
                    cmb_State.SelectedIndex = 0;
                }
                GetStatisticsCellCastList();
            }
            if (tbc_Statistics.SelectedIndex == 2)
            {
                dtp_Statistics_Swiping_StartTime.Text = DateTime.Now.AddDays(-1).ToString();
                cmb_Statistics_Swiping_TypeName.SelectedIndex = 0;
                uC_Page_Statistics_Swiping.tp.CurrentPage = 1;
                GetStatistics_SwipingList();
            }
            if (tbc_Statistics.SelectedIndex == 3)
            {
                dtp_Statistics_BackCard_StartTime.Text = DateTime.Now.AddDays(-1).ToString();
                List<CardTypeInfoModel> cardTypeInfoList = cardTypeManager.GetModelList(" 1=1");
                if (cardTypeInfoList != null)
                {
                    CardTypeInfoModel model = new CardTypeInfoModel();
                    model.CardTypeName = "全部";
                    model.CardTypeID = 0;
                    cardTypeInfoList.Add(model);

                    cmb_Statistics_BackCard_CardType.DataSource = cardTypeInfoList;
                    cmb_Statistics_BackCard_CardType.DisplayMember = "CardTypeName";
                    cmb_Statistics_BackCard_CardType.ValueMember = "CardTypeID";
                    cmb_Statistics_BackCard_CardType.SelectedIndex = 0;
                }
                cmb_Statistics_BackCard_CardType.SelectedIndex = cardTypeInfoList.Count - 1;
                uC_Page_Statistics_BackCard.tp.CurrentPage = 1;
                GetStatistics_BackCardList();

            }
            if (tbc_Statistics.SelectedIndex == 4)
            {
                dtp_Statistics_LossCard_CardID_StartTime.Text = DateTime.Now.AddDays(-1).ToString();
                uC_Page_Statistics_LossCard.tp.CurrentPage = 1;
                GetStatistics_LossCardList();
            }
        }