예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                InvoiceId = Convert.ToInt32((!string.IsNullOrWhiteSpace(Request.QueryString["invId"]) ? Request.QueryString["invId"] : "0"));
            }
            catch (Exception)
            {
                // ignored
            }

            if (!IsPostBack)
            {
                //if (Session["MemberID"] != null)
                //{
                //    MemberID = Convert.ToInt64(Session["MemberID"].ToString());

                //}
                LoadPageData();
                LoadInvoiceEnclosedDocument();

                if (MemberID > 0)
                {
                    ddlMember.SelectedValue = MemberID.ToString();
                    ddlMember.Enabled       = false;
                    ddlMember_SelectedIndexChanged(null, null);
                }
            }
        }
        public string GetWrapperName(MemberID ctorID)
        {
            var type     = Type.GetType(ctorID.AssemblyQualifiedTypeName);
            var ctorInfo = type.GetConstructors().FirstOrDefault(c => c.MetadataToken == ctorID.Token);

            return((string)_getWrapperMethod.Invoke(null, new[] { ctorInfo }));
        }
예제 #3
0
        public ActionResult Update(MemberID MemberID)
        {
            string valstr = string.Empty;

            #region 為了不寫死之後只改MODEL
            var MemberType = MemberID.GetType();

            foreach (var item in MemberType.GetProperties())
            {
                //因為ID是Identity  key值 要排除
                if (item.Name != "ID")
                {
                    valstr += item.Name + "=@" + item.Name + ",";
                }
            }
            valstr = valstr.TrimEnd(',');
            #endregion
            //這邊有空格 因為是語法 所以要空出來 EX:set後 跟 where 前
            var strSql = @"update Member set " + valstr + " where ID = @ID";
            using (SqlConnection con = new SqlConnection(Sqlcon))
            {
                con.Execute(strSql, MemberID);
            }

            return(RedirectToAction("Index"));
        }
        private bool ValidateInputFields(string pwd)
        {
            if (!EquitySegChk)
            {
                MessageBox.Show("Please Check the Segment CheckBox", "Segment Required", MessageBoxButton.OK, MessageBoxImage.Warning);
                return(false);
            }
            else if (string.IsNullOrWhiteSpace(MemberID))
            {
                MessageBox.Show("Please Enter Valid MemberID", "MemberID Required", MessageBoxButton.OK, MessageBoxImage.Warning);
                return(false);
            }
            else if (!MemberID.All(c => "0123456789".Contains(c)))
            {
                MessageBox.Show("Please Enter Numeric Member ID", "Numeric MemberID Required", MessageBoxButton.OK, MessageBoxImage.Warning);
                return(false);
            }
            else if (!TraderID.All(c => "0123456789".Contains(c)))
            {
                MessageBox.Show("Please Enter Numeric Trader Id", "Numeric TraderId Required", MessageBoxButton.OK, MessageBoxImage.Warning);
                return(false);
            }
            else if (string.IsNullOrWhiteSpace(TraderID))
            {
                MessageBox.Show("Please Enter Valid TraderID", "TraderID Required", MessageBoxButton.OK, MessageBoxImage.Warning);
                return(false);
            }
            else if (string.IsNullOrWhiteSpace(pwd))
            {
                MessageBox.Show("Please Enter Valid Password", "Password Required", MessageBoxButton.OK, MessageBoxImage.Warning);
                return(false);
            }

            return(true);
        }
예제 #5
0
    public void LoadDataBind(int pageIndex)
    {
        List <Expression> expression = new List <Expression>();

        expression.Add(new Expression("MemberID", "=", MemberID.ToStr()));
        int recordCount = 0;

        list = ActivityService.CouponNosService.Search(AspNetPager1.PageSize, pageIndex, expression, "SendDate desc", ref recordCount);
    }
예제 #6
0
    public void LoadDataBind(int pageIndex)
    {
        List <Expression> expression = new List <Expression>();

        expression.Add(new Expression("MemberID", "=", MemberID.ToStr()));

        int recordCount = 0;

        list = ProductService.QuestionsService.Search(AspNetPager1.PageSize, pageIndex, expression, " addDate desc", ref recordCount);
        AspNetPager1.RecordCount = recordCount;
    }
        public string GetUnspeakableMethodName(MemberID targetMethod, string name)
        {
            if (_virtualizedNameMethod == null)
            {
                return("<>virtualized_" + name);
            }

            var type       = Type.GetType(targetMethod.AssemblyQualifiedTypeName);
            var methodInfo = type.GetMethods().FirstOrDefault(c => c.MetadataToken == targetMethod.Token);

            return((string)_virtualizedNameMethod.Invoke(null, new[] { methodInfo }));
        }
        public bool ShouldVirtualizeMethod(MemberID targetMethod)
        {
            if (_virtualizeMethodMethod == null)
            {
                return(true);
            }

            var type       = Type.GetType(targetMethod.AssemblyQualifiedTypeName);
            var methodInfo = type.GetMethods().FirstOrDefault(c => c.MetadataToken == targetMethod.Token);

            return((bool)_virtualizeMethodMethod.Invoke(null, new[] { methodInfo }));
        }
        public MemberID GetFactoryMethodFunc(MemberID ctorID)
        {
            var type     = Type.GetType(ctorID.AssemblyQualifiedTypeName);
            var ctorInfo = type.GetConstructors().FirstOrDefault(c => c.MetadataToken == ctorID.Token);
            var result   = (MethodBase)_getFactoryMethod.Invoke(null, new[] { ctorInfo });

            if (result == null)
            {
                return(null);
            }
            return(new MemberID(result.DeclaringType.AssemblyQualifiedName, result.Module.FullyQualifiedName, result.MetadataToken));
        }
예제 #10
0
        public override string ToString()
        {
            //method to return a string about a member's basic information
            string staffdetail;

            staffdetail = MemberID.ToString() + " " + MemberName + " " + "Staff" + " \n " + "" + "\n";
            //find out all items the member is borrowing
            foreach (Loan a in ItemsBorrowed)
            {
                staffdetail += a.ToString() + "\n";
            }

            return(staffdetail);
        }
예제 #11
0
    public void LoadDataBind(int pageIndex)
    {
        List <Expression> expression = new List <Expression>();

        expression.Add(new Expression("MemberID", "=", MemberID.ToStr()));
        int recordCount = 0;
        List <TB_Product_Collection> list = ProductService.CollectionService.Search(AspNetPager1.PageSize, pageIndex, expression, "AddDate desc", ref recordCount);

        AspNetPager1.RecordCount = recordCount;
        foreach (TB_Product_Collection entity in list)
        {
            prolist.Add(ProductService.ProductsService.Get(entity.ProductID));
        }
    }
예제 #12
0
        public override string ToString()
        {
            //return student's basic information
            string studentdetail = "";

            studentdetail = MemberID.ToString() + " " + MemberName + " " + "Student" + "\n" + "" + "\n";
            //return all borrowed item's information
            foreach (Loan a in ItemsBorrowed)
            {
                studentdetail += a.ToString() + "\n";
            }

            return(studentdetail);
        }
예제 #13
0
    protected void btnUpload_Click(object sender, EventArgs e)
    {
        try
        {
            MemberID = Convert.ToInt32(Session["MemberID"]);

            string strChurchName = Session["ChurchID"].ToString();
            string strFileName   = fileMemberPhoto.PostedFile.FileName;
            string strFileEx     = Path.GetExtension(strFileName);
            strFileName = MemberID.ToString() + strFileEx;
            string strFilePath;
            string strFolder = "~/MemberPhoto/" + strChurchName + "/";
            strFolder = Server.MapPath(strFolder);
            if (fileMemberPhoto.HasFile)
            {
                if (!Directory.Exists(strFolder))
                {
                    Directory.CreateDirectory(strFolder);
                }
                strFilePath = strFolder + strFileName;
                if (File.Exists(strFilePath))
                {
                    File.Delete(strFilePath);
                }

                fileMemberPhoto.PostedFile.SaveAs(strFilePath);
            }
        }
        catch (Exception ex)
        {
            lblError.Text = "Please contact admin, uploading image has an issue.<br/>" + ex.Message + msgError.ToString();
        }
        //string strFileName = fileMemberPhoto.PostedFile.FileName;
        //strFileName = Path.GetFileName(strFileName);
        //strFileName = AppendTimeStamp(strFileName);
        //string strFilePath;
        //string strFolder = "~/MemberPhoto/Temp/";
        //if(fileMemberPhoto.HasFile)
        //{
        //    if (!Directory.Exists(strFolder))
        //        Directory.CreateDirectory(strFolder);
        //    strFilePath = strFolder + strFileName;
        //    if (File.Exists(strFilePath))
        //        File.Delete(strFilePath);

        //    fileMemberPhoto.PostedFile.SaveAs(Server.MapPath(strFolder) + strFileName);
        //}
    }
예제 #14
0
    protected void BtnDelete_Click(object sender, EventArgs e)
    {
        string pids = Request["pid"];

        if (!string.IsNullOrEmpty(pids))
        {
            foreach (string id in pids.Split(','))
            {
                List <Expression> expression = new List <Expression>();
                expression.Add(new Expression("MemberID", "=", MemberID.ToStr()));
                expression.Add(new Expression("ProductID", "=", id));
                ProductService.CollectionService.Delete(expression);
            }
        }
        LoadDataBind(1);
    }
예제 #15
0
    public void LoadDataBind()
    {
        List <Expression> expression = new List <Expression>();

        expression.Add(new Expression("MemberID", "=", MemberID.ToStr()));
        RepList.DataSource = MemberService.BuyerInfoService.Search(expression);
        RepList.DataBind();

        int id = Request.QueryString["id"].ToInt();

        if (id > 0)
        {
            TB_Member_BuyerInfo entity = MemberService.BuyerInfoService.Get(id);
            if (entity.ID > 0)
            {
                TbRealName.Text = entity.BuyerName;
                TbEmail.Text    = entity.Email;
                TbPosted.Text   = entity.PostalCode;
                TbMobile.Text   = entity.Mobile;
                string[] zone = entity.Zone.Split('|');
                Address.Value  = zone[0];
                TbAddress.Text = entity.Address;
                if (entity.Phone != "--")
                {
                    string[] phone = entity.Phone.Split('-');
                    switch (phone.Length)
                    {
                    case 1:
                        TbPhone.Text = phone[0];
                        break;

                    case 2:
                        TbPhone.Text  = phone[0];
                        TbPhone2.Text = phone[1];
                        break;

                    case 3:
                        TbPhone.Text  = phone[0];
                        TbPhone2.Text = phone[1];
                        TbPhone3.Text = phone[2];
                        break;
                    }
                }
                ViewState["id"] = entity.ID;
            }
        }
    }
예제 #16
0
        protected void btnFind_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = "btnFind_Click";

            try {
                FindSHID(txtSHID.Text);

                if (ShidChange != null)
                {
                    ShidChange(this, new CommandEventArgs(txtSHID.Text, MemberID.ToString()));
                }
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ShowWarning(ex);
            }
        }
예제 #17
0
    public void LoadDataBind(int pageIndex)
    {
        int recordCount = 0;
        List <Expression> expression = new List <Expression>();

        expression.Add(new Expression("MemberID", "=", MemberID.ToStr()));
        if (TbStartDate.Text != string.Empty && TbStartDate.Text != "请输入时间")
        {
            expression.Add(new Expression("AddDate", ">=", TbStartDate.Text));
        }
        if (TbStopDate.Text != string.Empty && TbStopDate.Text != "请输入时间")
        {
            expression.Add(new Expression("AddDate", "<=", TbStopDate.Text));
        }

        list = MemberService.IntergralService.Search(AspNetPager1.PageSize, pageIndex, expression, " addDate desc", ref recordCount);
        AspNetPager1.RecordCount = recordCount;
    }
예제 #18
0
    protected void LoadDataBind(int pageIndex)
    {
        List <Expression> expression = new List <Expression>();

        expression.Add(new Expression("MemberID", "=", MemberID.ToStr()));
        expression.Add(new Expression("State", "=", CommonClass.ReturnRequestInt("state", 0).ToStr()));

        int recordCount = 0;
        List <TB_ReturnGood_Order> list = OrderService.ReturnGoodOrderService.Search(AspNetPager1.PageSize, pageIndex, expression, "AddDate desc", ref recordCount);

        if (TbKey.Value != "订单编号")
        {
            list = list.Where(o => o.OrderNumber.Contains(TbKey.Value)).ToList();
        }

        RepList.DataSource = list;
        RepList.DataBind();
        AspNetPager1.RecordCount = recordCount;
    }
예제 #19
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (MemberID.Length != 0)
            {
                hash ^= MemberID.GetHashCode();
            }
            if (Photo.Length != 0)
            {
                hash ^= Photo.GetHashCode();
            }
            if (Content.Length != 0)
            {
                hash ^= Content.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
예제 #20
0
        protected void lvHRMember_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 MemberID;

            Int64.TryParse(e.CommandArgument.ToString(), out MemberID);

            if (MemberID > 0)
            {
                if (string.Equals(e.CommandName, "EditItem"))
                {
                    _MemberID = MemberID;

                    PrepareEditView();

                    //cpeEditor.Collapsed = false;
                    //cpeEditor.ClientState = "false";
                }
                else if (string.Equals(e.CommandName, "DeleteItem"))
                {
                    try
                    {
                        Int64 result = -1;

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(HRMemberEntity.FLD_NAME_MemberID, MemberID.ToString(), SQLMatchType.Equal);

                        HRMemberEntity hRMemberEntity = new HRMemberEntity();


                        result = FCCHRMember.GetFacadeCreate().Delete(hRMemberEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _MemberID       = 0;
                            _HRMemberEntity = new HRMemberEntity();
                            PrepareInitialView();
                            BindHRMemberList();

                            MiscUtil.ShowMessage(lblMessage, "Member has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Member.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
예제 #21
0
        private string Validate(string propertyName)
        {
            // Return error message if there is error on else return empty or null string
            string validationMessage = string.Empty;

            if (_firstLoad)
            {
                return(validationMessage);
            }
            switch (propertyName)
            {
            case "MemberID":     // property name
                if (!int.TryParse(MemberID.ToString(), out uselessIntParse))
                {
                    validationMessage = "Only Digits Are Allowed";
                }
                break;

            case "MemberName":
                if (string.IsNullOrWhiteSpace(MemberName))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberCell":
                if (!long.TryParse(MemberCell, out uselessParse))
                {
                    validationMessage = "Only Digits Are Allowed";
                }
                break;

            case "MemberVoterID":
                if (!long.TryParse(MemberVoterID, out uselessParse))
                {
                    validationMessage = "Only Digits Are Allowed";
                }
                break;

            case "MemberFather":
                if (string.IsNullOrWhiteSpace(MemberFather))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberMother":
                if (string.IsNullOrWhiteSpace(MemberMother))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberProfession":
                if (string.IsNullOrWhiteSpace(MemberProfession))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberReligion":
                if (string.IsNullOrWhiteSpace(MemberReligion))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberNationality":
                if (string.IsNullOrWhiteSpace(MemberNationality))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberPresentCO":
                if (string.IsNullOrWhiteSpace(MemberPresentCO))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberPresentVillage":
                if (string.IsNullOrWhiteSpace(MemberPresentVillage))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberPresentPost":
                if (string.IsNullOrWhiteSpace(MemberPresentPost))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberPresentThana":
                if (string.IsNullOrWhiteSpace(MemberPresentThana))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberPresentDistrict":
                if (string.IsNullOrWhiteSpace(MemberPresentDistrict))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberPermanentCO":
                if (string.IsNullOrWhiteSpace(MemberPermanentCO))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberPermanentVillage":
                if (string.IsNullOrWhiteSpace(MemberPermanentVillage))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberPermanentPost":
                if (string.IsNullOrWhiteSpace(MemberPermanentPost))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberPermanentThana":
                if (string.IsNullOrWhiteSpace(MemberPermanentThana))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberPermanentDistrict":
                if (string.IsNullOrWhiteSpace(MemberPermanentDistrict))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberNominee":
                if (string.IsNullOrWhiteSpace(MemberNominee))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberNomineeRelation":
                if (string.IsNullOrWhiteSpace(MemberNomineeRelation))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberPhoto":
                if (string.IsNullOrWhiteSpace(MemberPhoto))
                {
                    validationMessage = "No Picture Available";
                }
                break;

            case "MemberSignature":
                if (string.IsNullOrWhiteSpace(MemberPhoto))
                {
                    validationMessage = "No Picture Available";
                }
                break;

            case "DocumentName":
                if (string.IsNullOrWhiteSpace(MemberPhoto))
                {
                    validationMessage = "No Picture Available";
                }
                break;
            }

            return(validationMessage);
        }
        public bool ShouldVirtualizeType(MemberID targetType)
        {
            var type = Type.GetType(targetType.AssemblyQualifiedTypeName);

            return((bool)_virtualizeTypeMethod.Invoke(null, new[] { type }));
        }
예제 #23
0
        public async Task DeleteUserBulk(MemberID user)
        {
            using (var client = new HttpClient())
            {
                client.BaseAddress = new Uri("https://api.dropbox.com");
                client.DefaultRequestHeaders.Accept.Clear();
                client.DefaultRequestHeaders.Add("Authorization", "Bearer " + txtAccesstoken.Text);
                client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));


                var content = new MemberID();
                content.member_id = user.member_id;
                content.transfer_dest_member_id = user.transfer_dest_member_id;
                content.transfer_admin_member_id = user.transfer_admin_member_id;
                content.delete_data = user.delete_data;

                var response = await client.PostAsJsonAsync("1/team/members/remove", content);
                var returncontent = await response.Content.ReadAsStringAsync();

                if (!response.IsSuccessStatusCode)
                {
                    throw new Exception(returncontent.Replace("{", "").Replace("}", "").Replace("\"", " "));
                }

            }
        }
예제 #24
0
        public List<MemberID> ReadCSV()
        {
            int intline = 0;
            System.Collections.Generic.List<MemberID> results = new List<MemberID>();
            var reader = new StreamReader(OFDialog.FileName);
            while (!reader.EndOfStream)
            {
                var line = reader.ReadLine();

                if (!line.Contains("MemberID"))
                {
                    var values = line.Split(',');

                    if (values[0].Length == 0)
                    {
                            throw new Exception("Line number " + intline + " is incorrect and cannot be used, a member ID has not been specified. The program has stopped and no accounts have been created.");
                    }

                    MemberID mem = new MemberID();
                    mem.member_id = values[0];
                    mem.transfer_dest_member_id = values[1];
                    mem.transfer_admin_member_id = values[2];
                    mem.delete_data = Convert.ToBoolean(values[3]);
                    results.Add(mem);
                }

                intline += 1;

            }


            return results;
        }
예제 #25
0
 public bool AddMemberVote(string userid)
 {
     return(vda.AddMemberVote(VoteID.ToString(), MemberID.ToString(), userid, optids));
 }