Exemplo n.º 1
0
        private void SaveItem()
        {
            tm_Tabie entity = new tm_Tabie();

            if (action == "edit")
            {
                entity = Core.Container.Instance.Resolve <IServiceTabie>().GetEntity(_id);;
            }
            if (action == "add")
            {
                tm_Diningarea area = Core.Container.Instance.Resolve <IServiceDiningarea>().GetEntity(_id);
                entity.Diningarea_Tabie = area;
            }
            entity.TabieName   = txbTabieName.Text.Trim();
            entity.TabieNumber = numTabieNumber.Text;
            entity.SalesModel  = lstSalesModel.SelectedValue;
            entity.Sort        = Int32.Parse(numSort.Text);
            if (action == "edit")
            {
                Core.Container.Instance.Resolve <IServiceTabie>().Update(entity);
            }
            else
            {
                Core.Container.Instance.Resolve <IServiceTabie>().Create(entity);
            }
        }
Exemplo n.º 2
0
        private void Bind()
        {
            tm_Diningarea entity = Core.Container.Instance.Resolve <IServiceDiningarea>().GetEntity(_id);

            txbAreaName.Text = entity.AreaName;
            numFee.Text      = entity.Fee.ToString();
            numSort.Text     = entity.Sort.ToString();
        }
Exemplo n.º 3
0
        private void SaveItem()
        {
            tm_Diningarea entity = new tm_Diningarea();

            if (action == "edit")
            {
                entity = Core.Container.Instance.Resolve <IServiceDiningarea>().GetEntity(_id);;
            }
            entity.AreaName = txbAreaName.Text.Trim();
            entity.Fee      = decimal.Parse(numFee.Text);
            entity.Sort     = Int32.Parse(numSort.Text);
            if (action == "edit")
            {
                Core.Container.Instance.Resolve <IServiceDiningarea>().Update(entity);
            }
            else
            {
                Core.Container.Instance.Resolve <IServiceDiningarea>().Create(entity);
            }
        }
Exemplo n.º 4
0
 protected void btnSaveClose_Click(object sender, EventArgs e)
 {
     if (action == "add")
     {
         string             areaName = txbAreaName.Text.Trim();
         int                sort     = Int32.Parse(numSort.Text);
         IList <ICriterion> qryList  = new List <ICriterion>();
         qryList.Add(Expression.Disjunction()
                     .Add(Expression.Eq("AreaName", areaName))
                     .Add(Expression.Eq("Sort", sort))
                     );
         tm_Diningarea entity = Core.Container.Instance.Resolve <IServiceDiningarea>().GetEntityByFields(qryList);
         if (entity != null)
         {
             Alert.ShowInTop("已存在餐区名[ " + entity.AreaName + " ]排序为[ " + entity.Sort + " ]的餐区!保存失败", MessageBoxIcon.Warning);
             return;
         }
     }
     SaveItem();
     PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
 }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //权限检查
                CheckPowerWithButton("CoreTabieEdit", btnSaveClose);
                //绑定销售模式
                BindDateTime();

                if (action == "edit")
                {
                    Bind();
                }
                else
                {
                    tm_Diningarea area = Core.Container.Instance.Resolve <IServiceDiningarea>().GetEntity(_id);
                    labDiningArea.Text = area.AreaName;
                }
                btnClose.OnClientClick = ActiveWindow.GetHideReference();
            }
        }